summaryrefslogtreecommitdiffstats
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* - Always print the trap number so that we have something to start with forjhb2005-11-181-5/+10
| | | | | | | | mystery traps. If we don't have a message for a given trap, just use UNKNOWN for the message. - Add trap messages for T_XMMFLT and T_RESERVED. MFC after: 1 week
* Fix spelling mistake.obrien2005-11-171-1/+1
| | | | Submitted by: kris
* Revert a part of the previous commits to these files that made the NMIjhb2005-11-161-5/+4
| | | | | | | | | IPI_STOP handling code use atomic_readandclear() to execute the restart function on the first CPU to resume and restore the behavior of always executing the restart function on the BSP since this is in fact what the non-NMI IPI_STOP handler does. I did add back in a statement to clear the restart function pointer after it is executed to match the behavior of the non-NMI IPI_STOP handler.
* Revert previous commit to these files. There isn't a race necessitatingjhb2005-11-161-3/+2
| | | | | an xchg instruction as we only try to execute the startup function if the CPU ID is 0 (i.e. the BSP). I missed this earlier.
* Fix a typo in the check for an invalid APIC. If we are told about anjhb2005-11-161-1/+1
| | | | | | | | | I/O APIC that doesn't exist, then a read of the version register is going to return -1 which is 0xffffffff not 0xffffff. Tested on: i386 Tested by: Nikos Ntarmos ntarmos at ceid dot upatras dot gr MFC after: 1 week
* Provide a link to the documentation of the I/O APIC at Intel.andre2005-11-151-0/+4
|
* Provide a dummy NO_XBOX option that lives in opt_xbox.h for pc98.imp2005-11-143-6/+0
| | | | This allows us to eliminate a three ifdef PC98 instances.
* Add xbox associated options/devices to LINT.imp2005-11-141-0/+17
| | | | Submitted by: Rink P.W. Springer
* In get_pv_entry() use PMAP_LOCK() instead of PMAP_TRYLOCK() when deadlockalc2005-11-131-1/+4
| | | | cannot possibly occur.
* Add /dev/speaker support to amd64.ru2005-11-112-674/+5
| | | | | | | | The following repo-copies were made (by Mark Murray): sys/i386/isa/spkr.c -> sys/dev/speaker/spkr.c sys/i386/include/speaker.h -> sys/dev/speaker/speaker.h share/man/man4/man4.i386/spkr.4 -> share/man/man4/spkr.4
* Fix pc98 build.nyan2005-11-093-0/+6
|
* Reimplement the reclamation of PV entries. Specifically, performalc2005-11-091-35/+42
| | | | | | | | | | | | | | | | | | reclamation synchronously from get_pv_entry() instead of asynchronously as part of the page daemon. Additionally, limit the reclamation to inactive pages unless allocation from the PV entry zone or reclamation from the inactive queue fails. Previously, reclamation destroyed mappings to both inactive and active pages. get_pv_entry() still, however, wakes up the page daemon when reclamation occurs. The reason being that the page daemon may move some pages from the active queue to the inactive queue, making some new pages available to future reclamations. Print the "reclaiming PV entries" message at most once per minute, but don't stop printing it after the fifth time. This way, we do not give the impression that the problem has gone away. Reviewed by: tegge
* Remove obsolete optionsimp2005-11-091-1/+0
|
* Add support for XBOX to the FreeBSD port. The xbox architecture isimp2005-11-0910-0/+928
| | | | | | | | | | | | | | | | | | | | nearly identical to wintel/ia32, with a couple of tweaks. Since it is so similar to ia32, it is optionally added to a i386 kernel. This port is preliminary, but seems to work well. Further improvements will improve the interaction with syscons(4), port Linux nforce driver and future versions of the xbox. This supports the 64MB and 128MB boxes. You'll need the most recent CVS version of Cromwell (the Linux BIOS for the XBOX) to boot. Rink will be maintaining this port, and is interested in feedback. He's setup a website http://xbox-bsd.nl to report the latest developments. Any silly mistakes are my fault. Submitted by: Rink P.W. Springer rink at stack dot nl and Ed Schouten ed at fxq dot nl
* The hptmv inherently believes that a 'long' can hold a physical address.scottl2005-11-081-0/+1
| | | | | | | | This hasn't been true on i386 for at least a decade, probably longer, but I'm too lazy to look up the exact year that PAE support was introduced. Thus, this driver doesn't work on PAE. X-MFC After: now
* Add uart(4). When both sio(4) and uart(4) can handle a serial port,marcel2005-11-051-1/+2
| | | | | | | | sio(4) will claim it. This change therefore only affects how ports are handled when they are not claimed by sio(4), and in principle will improve hardware support. MFC after: 2 months
* Unbreak !SMP kernelsphk2005-11-051-0/+2
|
* MFamd64: indent with tabs instead of spaces.peter2005-11-041-1/+1
|
* Begin and end the initialization of pvzone in pmap_init().alc2005-11-041-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, pvzone's initialization was split between pmap_init() and pmap_init2(). This split initialization was the underlying cause of some UMA panics during initialization. Specifically, if the UMA boot pages was exhausted before the pvzone was fully initialized, then UMA, through no fault of its own, would use an inappropriate back-end allocator leading to a panic. (Previously, as a workaround, we have increased the UMA boot pages.) Fortunately, there is no longer any reason that pvzone's initialization cannot be completed in pmap_init(). Eliminate a check for whether pv_entry_high_water has been initialized or not from get_pv_entry(). Since pvzone's initialization is completed in pmap_init(), this check is no longer needed. Use cnt.v_page_count, the actual count of available physical pages, instead of vm_page_array_size to compute the maximum number of pv entries. Introduce the vm.pmap.pv_entries tunable on alpha and ia64. Eliminate some unnecessary white space. Discussed with: tegge (item #1) Tested by: marcel (ia64)
* Change the x86 code to allocate IDT vectors on-demand when an interruptjhb2005-11-024-96/+217
| | | | | | | | | | | | | | | | source is first enabled similar to how intr_event's now allocate ithreads on-demand. Previously, we would map IDT vectors 1:1 to IRQs. Since we only have 191 available IDT vectors for I/O interrupts, this limited us to only supporting IRQs 0-190 corresponding to the first 190 I/O APIC intpins. On many machines, however, each PCI-X bus has its own APIC even though it only has 1 or 2 devices, thus, we were reserving between 24 and 32 IRQs just for 1 or 2 devices and thus 24 or 32 IDT vectors. With this change, a machine with 100 IRQs but only 5 in use will only use up 5 IDT vectors. Also, this change provides an API (apic_alloc_vector() and apic_free_vector()) that will allow a future MSI interrupt source driver to request IDT vectors for use by MSI interrupts on x86 machines. Tested on: amd64, i386
* Throw the switch and turn on STOP_NMI on in GENERIC for amd64 and i386.jhb2005-11-011-0/+1
| | | | | Requested by: kris Ok'd by: scottl
* Catch up with ACPI-CA 20051021 importjkim2005-11-011-1/+1
|
* Instead of a panic()ing in pmap_insert_entry() if get_pv_entry()alc2005-10-311-8/+65
| | | | | | | | | | fails, reclaim a pv entry by destroying a mapping to an inactive page. Change the format strings in many of the assertions that were recently converted from PMAP_DIAGNOSTIC printf()s so that they are compatible with PAE. Avoid unnecessary differences between the amd64 and i386 format strings.
* Hook nve(4) up in i386 and amd64 NOTES.jhb2005-10-311-0/+2
| | | | MFC after: 1 week
* Normalize a significant number of kernel malloc type names:rwatson2005-10-313-3/+3
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* Replace diagnostic printf()s by assertions. Use consistent style foralc2005-10-301-36/+8
| | | | similar assertions.
* Finally complete some work on generalizing the PCF8584-based I2Cjoerg2005-10-281-633/+0
| | | | | | | | | | | drivers I started quite some time before. Retire the old i386-only pcf driver, and activate the new general driver that has been sitting in the tree already for quite some time. Build the i2c modules for sparc64 architectures as well (where I've been developing all this on).
* Create a default kernel config for i386 and move 'device isa' andjhb2005-10-272-7/+18
| | | | | | | | | 'device npx' (both of which aren't really optional right now) and 'device io' and 'device mem' (to preserve POLA for 4.x users upgrading to 6.0) from GENERIC into DEFAULTS. Requested by: scottl Reviewed by: scottl
* Reorganize the interrupt handling code a bit to make a few things cleanerjhb2005-10-253-55/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes) Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel)
* Undo the change to pci_cfgdisable() on i386 for now. It seems to fixwpaul2005-10-251-6/+2
| | | | the amd64 case, but makes the i386 case fail even more often.
* Modify the pci_cfgdisable() routine to bring it more in line withwpaul2005-10-251-3/+7
| | | | | | | | | | | | | other OSes (Solaris, Linux, VxWorks). It's not necessary to write a 0 to the config address register when using config mechanism 1 to turn off config access. In fact, it can be downright troublesome, since it seems to confuse the PCI-PCI bridge in the AMD8111 chipset and cause it to sporadically botch reads from some devices. This is the cause of the missing USP ports problem I was experiencing with my Sun Opteron system. Also correct the case for mechanism 2: it's only necessary to write a 0 to the ENABLE port.
* Rename the KDB_STOP_NMI kernel option to STOP_NMI and make it apply to alljhb2005-10-244-16/+50
| | | | | | | | | | | | | | | | | | | | | | IPI_STOP IPIs. - Change the i386 and amd64 MD IPI code to send an NMI if STOP_NMI is enabled if an attempt is made to send an IPI_STOP IPI. If the kernel option is enabled, there is also a sysctl to change the behavior at runtime (debug.stop_cpus_with_nmi which defaults to enabled). This includes removing stop_cpus_nmi() and making ipi_nmi_selected() a private function for i386 and amd64. - Fix ipi_all(), ipi_all_but_self(), and ipi_self() on i386 and amd64 to properly handle bitmapped IPIs as well as IPI_STOP IPIs when STOP_NMI is enabled. - Fix ipi_nmi_handler() to execute the restart function on the first CPU that is restarted making use of atomic_readandclear() rather than assuming that the BSP is always included in the set of restarted CPUs. Also, the NMI handler didn't clear the function pointer meaning that subsequent stop and restarts could execute the function again. - Define a new macro HAVE_STOPPEDPCBS on i386 and amd64 to control the use of stoppedpcbs[] and always enable it for i386 and amd64 instead of being dependent on KDB_STOP_NMI. It works fine in both the NMI and non-NMI cases.
* When restarting the BSP during cpu_reset() use a membar to ensure thatjhb2005-10-241-1/+4
| | | | | the updated cpustop_restartfunc is seen when the BSP resumes execution. This matches the membar already present in restart_cpus().
* Use xchg in Xcpustop to close a race and make cpustop_restartfunc trulyjhb2005-10-241-2/+3
| | | | | one-shot in the SMP case (before using the simple mov / cmp / mov sequence could allow multiple CPUs to execute the restart function on resume).
* - Various small whitespace and style nits.jhb2005-10-241-14/+10
| | | | | - Use PCPU_GET(cpumask) in preference to 1 << PCPU_GET(cpuid) in a few places.
* Like acpi_throttle, set frequency to 100% in attach. Some BIOSen may setnjl2005-10-231-0/+8
| | | | this value lower, making the system quite slow after booting.
* Specifically panic() in the case where pmap_insert_entry() fails toade2005-10-211-0/+2
| | | | | | | | | | | | get a new pv under high system load where the available pv entries have been exhausted before the pagedaemon has a chance to wake up to reclaim some. Prior to this, the NULL pointer dereference ended up causing secondary panics with rather less than useful resulting tracebacks. Reviewed by: alc, jhb MFC after: 1 week
* Use svr4_si_{addr,code,errno,signo,trap} in preference to si_{...}.rwatson2005-10-191-36/+36
| | | | | | | | Fix a debugging printf to printf after a variable is first assigned, not before. These are purely build fixes, and need inspection to make sure they were what the original author of the previous changes intended.
* Redo physical/logical CPU count.jkim2005-10-171-3/+4
| | | | Suggested by: jhb
* Split displaying number of physical and logical cores.jkim2005-10-171-2/+3
|
* For AMD processors, nullify CPUID.HTT. FreeBSD has no need for theobrien2005-10-161-0/+9
| | | | | information it conveys, and it is only confusing people. This fixes incorrect output in the previous commit.
* Fix compiling.davidxu2005-10-151-1/+1
|
* - Print number of physical/logical cores and more CPUID info.jkim2005-10-144-14/+105
| | | | | | | | | - Add newer CPUID definitions for future use. Many thanks to Mike Tancsa <mike at sentex dot net> for providing test cases for Intel Pentium D and AMD Athlon 64 X2. Approved by: anholt (mentor)
* The signal code is now an int rather than a long, so update debug printfs.jhb2005-10-141-2/+2
|
* Remove the sx(4) driver at the request of the author. The authorjhb2005-10-141-3/+0
| | | | | | | | | originally wrote it for 4.x and hasn't really had the time to fully update it to 5.x and later. Also, the author doesn't use the hardware anymore as well. If someone does need this driver they can always resurrect it from the Attic. Requested by: Frank Mayhar frank at exit dot com
* Sort ath_rate_* entries. Mark ath_rate_sample as the desired algorithm.ru2005-10-141-2/+2
| | | | Discussed with: sam
* 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, mostdavidxu2005-10-144-87/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes in MD code are trivial, before this change, trapsignal and sendsig use discrete parameters, now they uses member fields of ksiginfo_t structure. For sendsig, this change allows us to pass POSIX realtime signal value to user code. 2. Remove cpu_thread_siginfo, it is no longer needed because we now always generate ksiginfo_t data and feed it to libpthread. 3. Add p_sigqueue to proc structure to hold shared signals which were blocked by all threads in the proc. 4. Add td_sigqueue to thread structure to hold all signals delivered to thread. 5. i386 and amd64 now return POSIX standard si_code, other arches will be fixed. 6. In this sigqueue implementation, pending signal set is kept as before, an extra siginfo list holds additional siginfo_t data for signals. kernel code uses psignal() still behavior as before, it won't be failed even under memory pressure, only exception is when deleting a signal, we should call sigqueue_delete to remove signal from sigqueue but not SIGDELSET. Current there is no kernel code will deliver a signal with additional data, so kernel should be as stable as before, a ksiginfo can carry more information, for example, allow signal to be delivered but throw away siginfo data if memory is not enough. SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can not be caught or masked. The sigqueue() syscall allows user code to queue a signal to target process, if resource is unavailable, EAGAIN will be returned as specification said. Just before thread exits, signal queue memory will be freed by sigqueue_flush. Current, all signals are allowed to be queued, not only realtime signals. Earlier patch reviewed by: jhb, deischen Tested on: i386, amd64
* Add POSIX siginfo_t's si_code, this is for upcoming POSIX realtime signaldavidxu2005-10-141-10/+0
| | | | | | support in kernel. Earlier patch reviewed by: jhb, deischen
* Restore the UP optimization to reduce the number of TLB invalidations. Thealc2005-10-131-4/+11
| | | | | | | | | previous revision only restored the MP optimization. Describe the optimization strategy for TLB invalidations in a comment. Reviewed by: ups@ MFC after: 3 days
* Restore optimizations to reduce TLB shootdowns.ups2005-10-131-25/+24
| | | | | | | Alan Cox pointed out that they are really useful for sendfile(). MFC after: 3 days
OpenPOWER on IntegriCloud