aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* Change <b28> to HTT (Hyperthreading technology). If this flag is set thenPeter Wemm2002-01-161-3/+3
| | | | | | | | | | cpuid with %eax=1 will return a logical cpu count in bits 16-23 of %ebx. Bit 29 is actually 'TM' according to AP-485. This signifies the presence of the thermal control circuit (which I believe can slow the clock down to reduce core temperature). Notes: svn path=/head/; revision=89412
* Ensure that we set all the %cr0 bits to a known state for the AP's beforePeter Wemm2002-01-163-0/+30
| | | | | | | | | they make it through to userland. This should fix the p5-smp problem without affecting the other cpus (eg: cyrix, see initcpu.c and the special cache handling for these cpu types). Notes: svn path=/head/; revision=89410
* Sync to GENERIC: add UFS_DIRHASHWarner Losh2002-01-151-0/+1
| | | | | | | Submitted by: Anders Andersson <anders@hack.org> Notes: svn path=/head/; revision=89382
* Replace ffind_* with fget calls.Alfred Perlstein2002-01-142-4/+4
| | | | | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf(). Notes: svn path=/head/; revision=89319
* SMP Lock struct file, filedesc and the global file list.Alfred Perlstein2002-01-134-68/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=89306
* Clear the single-step flag for signal handlers. This fixes bogus traceBruce Evans2002-01-104-9/+10
| | | | | | | | | | | | | | | | | | | traps on the first instruction of signal handlers. In trap.c:syscall(), fake a trace trap if the single-step flag was set on entry to the kernel, not if it will be set on exit from the kernel. This fixes bogus trace traps after the last instruction of signal handlers. gdb-4.18 (the version in FreeBSD) still has problems with the program in the PR. These seem to be due to bugs in gdb and not in FreeBSD, and are fixed in gdb-5.1 (the distribution version). PR: 33262 Tested by: k Macy <kip_macy@yahoo.com> MFC after: 1 day Notes: svn path=/head/; revision=89195
* Fix typo in function name.Wes Peters2002-01-101-1/+1
| | | | | | | | Reviewed by: peter@ Obtained from: mux@sneakerz.org Notes: svn path=/head/; revision=89179
* Use a spare slot in the machine context for a flags word to indicateDaniel Eischen2002-01-102-1/+5
| | | | | | | | | | | | | whether the machine context is valid and whether the FPU state is valid (saved). Mark the machine context valid before copying it out when sending a signal. Approved by: -arch Notes: svn path=/head/; revision=89175
* Fix S3 breakage.Takanori Watanabe2002-01-091-1/+2
| | | | | | | | Now AcpiEnterSleep() is light enough, so flushing cache before the function is not too early. Notes: svn path=/head/; revision=89156
* - generic Arcnet frameworkMax Khon2002-01-081-0/+9
| | | | | | | | | - device driver for SMC COM90cx6 Arcnet network adapters Obtained from: NetBSD Notes: svn path=/head/; revision=89099
* Gut this header; since physio_proc_init is never called, the code never doesMike Smith2002-01-081-34/+1
| | | | | | | anything more than multiply declare some unused variables. Notes: svn path=/head/; revision=89064
* Staticise devclasses and some unnecessarily global variables.Mike Smith2002-01-081-1/+1
| | | | Notes: svn path=/head/; revision=89054
* Convert a bunch of 1 << PCPU_GET(cpuid) to PCPU_GET(cpumask).Peter Wemm2002-01-054-9/+9
| | | | Notes: svn path=/head/; revision=88903
* Change the preemption code for software interrupt thread schedules andJohn Baldwin2002-01-057-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=88900
* GC unfinished function selected_proc_ipi(). It is a duplicate ofPeter Wemm2002-01-051-30/+0
| | | | | | | apic_ipi_singledest() anyway. Notes: svn path=/head/; revision=88896
* Allow a specific setting for pv entries. This avoids the need to guessPeter Wemm2002-01-031-0/+1
| | | | | | | | (or calculate by hand) the effect of interactions between shpgperproc, physical ram size, maxproc, maxdsiz, etc. Notes: svn path=/head/; revision=88838
* Add the nullmodem deviceJulian Elischer2002-01-011-0/+1
| | | | Notes: svn path=/head/; revision=88754
* Grrr. The tlb code is strewn over 3 files and I misread it. RevertMatthew Dillon2001-12-311-8/+0
| | | | | | | | the last change (it was a NOP), and remove the XXX comments that no longer apply. Notes: svn path=/head/; revision=88744
* You know those 'XXX what about SMP' comments in pmap_kenter()? Well,Matthew Dillon2001-12-311-3/+10
| | | | | | | | | | | | | they were right. Fix both kenter() and kremove() for SMP by ensuring that the tlb is flushed on other cpu's. This will directly solve random-corruption panic issues in -stable when it is MFC'd. Better to be safe then sorry, we can optimize this later. Original Suspicion by: peter Maybe MFC: immediately on re's permission Notes: svn path=/head/; revision=88742
* GC an alternate trap_pfault() which has rotted away behind an "#ifdef notyet"Poul-Henning Kamp2001-12-301-118/+0
| | | | | | | since 21-Mar-95 . Notes: svn path=/head/; revision=88719
* Add the ifpi2 driver.Gary Jennejohn2001-12-221-0/+7
| | | | | | | MFC after: 4 weeks Notes: svn path=/head/; revision=88405
* Add support for the AVM Fritz!Card PCI version 2 controller.Gary Jennejohn2001-12-221-2/+4
| | | | | | | MFC after: 4 weeks Notes: svn path=/head/; revision=88404
* Use the new resource_list_print_type() function.Thomas Moestl2001-12-211-1/+1
| | | | | | | | Pass the bus device to isa_init() (this is needed for the sparc64 version). Notes: svn path=/head/; revision=88376
* Add support for the Intel 82443MX chipsetJim Pirzyk2001-12-211-1/+1
| | | | | | | | PR: kern/33032 MFC after: 1 month Notes: svn path=/head/; revision=88323
* Introduce a standard name for the lock protecting an interrupt controllerJohn Baldwin2001-12-2017-119/+84
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=88322
* I am not sure if it is a good idea or not to have my id in the cvs logPeter Wemm2001-12-201-824/+797
| | | | | | | | | | for this file, but here goes nothing. This was my first attempt at tidying up this file. Unfortunately, it just exposes many more horrors in the code itself that had been masked by the eyesore that was there before. I think this just needs to be put out of its misery. Notes: svn path=/head/; revision=88246
* Replace a bunch of:Peter Wemm2001-12-201-20/+6
| | | | | | | | | | | 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) { Notes: svn path=/head/; revision=88245
* Fix some whitespace nits, and a minor error that I made in some unusedPeter Wemm2001-12-201-8/+7
| | | | | | | #ifdef DEBUG code (VM_MAXUSER_ADDRESS vs UPT_MAX_ADDRESS). Notes: svn path=/head/; revision=88240
* Comment out DEVICE_POLLING so that LINT compiles again.Poul-Henning Kamp2001-12-191-1/+2
| | | | Notes: svn path=/head/; revision=88224
* Axe stale extern for a non-existent variable.John Baldwin2001-12-181-1/+0
| | | | Notes: svn path=/head/; revision=88152
* In a couple of places, we recalculated addresses we already had in localJulian Elischer2001-12-181-3/+3
| | | | | | | pointer variables. Notes: svn path=/head/; revision=88146
* Various assembly fixes mostly in the form of using the "+" modifier forJohn Baldwin2001-12-183-29/+29
| | | | | | | | | | output operands to mark them as both input and output rather than listing operands twice. Reviewed by: bde Notes: svn path=/head/; revision=88118
* Allow the ATOMIC_ASM() macro to pass in the constraints on the V parameterJohn Baldwin2001-12-181-23/+23
| | | | | | | | | | since the char versions need to use either ax, bx, cx, or dx. Submitted by: Peter Jeremy (mostly) Recommended by: bde Notes: svn path=/head/; revision=88117
* With GCC 3, we *must* use the GCC stdarg.h. We can no longer just makeDavid E. O'Brien2001-12-181-0/+6
| | | | | | | _BSD_VA_LIST_ match what we think the compiler is doing. Notes: svn path=/head/; revision=88107
* Modify the critical section API as follows:John Baldwin2001-12-1810-140/+93
| | | | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=88088
* Small cleanups to the SMP code:John Baldwin2001-12-174-101/+48
| | | | | | | | | | | | | | - 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. Notes: svn path=/head/; revision=88085
* Add description of DEVICE_POLLING option.Luigi Rizzo2001-12-141-0/+19
| | | | Notes: svn path=/head/; revision=87963
* Clarify the comments related to DUMMYNET and HZLuigi Rizzo2001-12-141-7/+12
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=87962
* Device Polling code for -current.Luigi Rizzo2001-12-141-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-SMP, i386-only, no polling in the idle loop at the moment. To use this code you must compile a kernel with options DEVICE_POLLING and at runtime enable polling with sysctl kern.polling.enable=1 The percentage of CPU reserved to userland can be set with sysctl kern.polling.user_frac=NN (default is 50) while the remainder is used by polling device drivers and netisr's. These are the only two variables that you should need to touch. There are a few more parameters in kern.polling but the default values are adequate for all purposes. See the code in kern_poll.c for more details on them. Polling in the idle loop will be implemented shortly by introducing a kernel thread which does the job. Until then, the amount of CPU dedicated to polling will never exceed (100-user_frac). The equivalent (actually, better) code for -stable is at http://info.iet.unipi.it/~luigi/polling/ and also supports polling in the idle loop. NOTE to Alpha developers: There is really nothing in this code that is i386-specific. If you move the 2 lines supporting the new option from sys/conf/{files,options}.i386 to sys/conf/{files,options} I am pretty sure that this should work on the Alpha as well, just that I do not have a suitable test box to try it. If someone feels like trying it, I would appreciate it. NOTE to other developers: sure some things could be done better, and as always I am open to constructive criticism, which a few of you have already given and I greatly appreciated. However, before proposing radical architectural changes, please take some time to possibly try out this code, or at the very least read the comments in kern_poll.c, especially re. the reason why I am using a soft netisr and cannot (I believe) replace it with a simple timeout. Quick description of files touched by this commit: sys/conf/files.i386 new file kern/kern_poll.c sys/conf/options.i386 new option sys/i386/i386/trap.c poll in trap (disabled by default) sys/kern/kern_clock.c initialization and hardclock hooks. sys/kern/kern_intr.c minor swi_net changes sys/kern/kern_poll.c the bulk of the code. sys/net/if.h new flag sys/net/if_var.h declaration for functions used in device drivers. sys/net/netisr.h NETISR_POLL sys/dev/fxp/if_fxp.c sys/dev/fxp/if_fxpvar.h sys/pci/if_dc.c sys/pci/if_dcreg.h sys/pci/if_sis.c sys/pci/if_sisreg.h device driver modifications Notes: svn path=/head/; revision=87902
* Enable UFS_DIRHASH in the GENERIC kernel.Ian Dowse2001-12-141-0/+1
| | | | | | | | | Suggested by: silby Reviewed by: dillon MFC after: 5 days Notes: svn path=/head/; revision=87894
* Fixed to draw mouse cursor. The syscons driver for PC98 uses differentYoshihiro Takahashi2001-12-141-0/+5
| | | | | | | | | | attributes from i386. Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata) MFC after: 3 days Notes: svn path=/head/; revision=87886
* o Clarify the comments on AIO to note that yes, AIO really is unsuitableRobert Watson2001-12-141-2/+2
| | | | | | | | | for use on machines with untrusted local users, for security as well as stability reasons. o Lack of clarity pointed out by: David Rufino <dr@soniq.net> via bugtraq. Notes: svn path=/head/; revision=87870
* Add maxusers auto-sizing description to NOTES file for -currentMatthew Dillon2001-12-141-1/+3
| | | | Notes: svn path=/head/; revision=87830
* Axe an unneeded PCPU_SET(spinlocks, NULL) that I missed earlier.John Baldwin2001-12-123-3/+0
| | | | Notes: svn path=/head/; revision=87721
* Overhaul the per-CPU support a bit:John Baldwin2001-12-1121-414/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=87702
* Delete some leftover code from a bygone age. We dont have an array ofPeter Wemm2001-12-111-11/+1
| | | | | | | IdlePTDS anymore and dont to the PTD[MPPTDI] swapping etc. Notes: svn path=/head/; revision=87637
* Add new boot flag to i386 boot: -p.Guido van Rooij2001-12-101-1/+1
| | | | | | | | | | | | | | | This flag adds a pausing utility. When ran with -p, during the kernel probing phase, the kernel will pause after each line of output. This pausing can be ended with the '.' key, and is automatically suspended when entering ddb. This flag comes in handy at systems without a serial port that either hang during booting or reser. Reviewed by: (partly by jlemon) MFC after: 1 week Notes: svn path=/head/; revision=87620
* Add identification string for AMD-761 host to PCI bridge.Murray Stokely2001-12-101-0/+3
| | | | | | | PR: kern/32255 Notes: svn path=/head/; revision=87603
* Update to C99, s/__FUNCTION__/__func__/,David E. O'Brien2001-12-103-6/+6
| | | | | | | also don't use ANSI string concatenation. Notes: svn path=/head/; revision=87599
* style(9)David E. O'Brien2001-12-091-7/+7
| | | | Notes: svn path=/head/; revision=87572