aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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-181-14/+14
| | | | | | | | | | 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
* Modify the critical section API as follows:John Baldwin2001-12-189-71/+39
| | | | | | | | | | | | | | | | | | | | | | - 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
* 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
* 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-1119-227/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Allow maxusers to be specified as 0 in the kernel config, which willMatthew Dillon2001-12-092-2/+3
| | | | | | | | | | cause the system to auto-size to between 32 and 512 depending on the amount of memory. MFC after: 1 week Notes: svn path=/head/; revision=87546
* Update pathnames for creation of tags file.Kirk McKusick2001-12-051-1/+1
| | | | Notes: svn path=/head/; revision=87373
* PROCFS requires PSEUDOFS. I forgot that GENERIC didn't have PSEUDOFS yet.Dag-Erling Smørgrav2001-12-041-1/+2
| | | | Notes: svn path=/head/; revision=87340
* Add a missing open paren to a macro that's been broken (and apparentlyJohn Baldwin2001-12-041-1/+1
| | | | | | | | | unused) since rev 1.1 so it is at least correct. Submitted by: Maxime Henrion <mux@qualys.com> Notes: svn path=/head/; revision=87311
* cpuid bit 30 is 'IA64', for when you're running in i386 mode on an ia64Peter Wemm2001-11-301-1/+1
| | | | | | | | cpu. (This is for either userland apps running in i386 mode on an ia64 OS, or when the cpu is in i386 legacy mode running an i386 OS). Notes: svn path=/head/; revision=87122
* MFS: I was confused. This code wasn't in -current after all.Warner Losh2001-11-261-5/+14
| | | | | | | | | | Merge in the irq 0 detection. Add comment about why. If we have irq 0, ignore it like we do irq 255. Some BIOS writers aren't careful like they should be. Notes: svn path=/head/; revision=86921
* Yet another verbose printing cleanup. Remove debug_wakeup flag andMitsuru IWASAKI2001-11-181-5/+2
| | | | | | | check common verbose flag instead. Notes: svn path=/head/; revision=86554
* Fix the non-KSTACK_GUARD case.. It has been broken since the KSEPeter Wemm2001-11-171-0/+1
| | | | | | | commit. ptek was not been initialized. Notes: svn path=/head/; revision=86486
* Start bringing i386/pmap.c into line with cleanups that were done toPeter Wemm2001-11-173-257/+192
| | | | | | | | | | | | | | | | | | alpha pmap. In particular - - pd_entry_t and pt_entry_t are now u_int32_t instead of a pointer. This is to enable cleaner PAE and x86-64 support down the track sor that we can change the pd_entry_t/pt_entry_t types to 64 bit entities. - Terminate "unsigned *ptep, pte" with extreme prejudice and use the correct pt_entry_t/pd_entry_t types. - Various other cosmetic changes to match cleanups elsewhere. - This eliminates a boatload of casts. - use VM_MAXUSER_ADDRESS in place of UPT_MIN_ADDRESS in a couple of places where we're testing user address space limits. Assuming the page tables start directly after the end of user space is not a safe assumption. There is still more to go. Notes: svn path=/head/; revision=86485
* Oops, I accidently merged a whitespace error from the original commit.Peter Wemm2001-11-161-1/+1
| | | | | | | (whitespace at end of line in rev 1.264 pmap.c). Fix them all. Notes: svn path=/head/; revision=86443
* Converge/fix some debug code (#if 0'ed on alpha, but whatever)Peter Wemm2001-11-161-14/+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) Notes: svn path=/head/; revision=86439
* Allow bit 21 of EFLAGS register (PSL_ID) be changed in the use-mode withoutMaxim Sobolev2001-11-151-1/+1
| | | | | | | | | | | | | ill effects. This should fix problems threaded programs are having with auto-detecting CPU type. Reported by: Joe Clarke <marcus@marcuscom.com> Tested by: Joe Clarke <marcus@marcuscom.com> Reviewed by: jhb MFC after: 1 week Notes: svn path=/head/; revision=86430
* - Don't enable interrupts in trap() if we trapped while holding a spinJohn Baldwin2001-11-151-6/+17
| | | | | | | | | | | lock as this usually makes the problem worse. - If we get a page fault while holding a spin lock, treat it as a fatal trap and don't even bother calling into the VM since calling into the VM will panic when trying to lock Giant before we can get a useful message anyways. Notes: svn path=/head/; revision=86408
* Use newer constraints for atomic_cmpset().John Baldwin2001-11-121-11/+9
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=86303
* Use newer constraints for inline assembly for an operand that is both anJohn Baldwin2001-11-121-21/+21
| | | | | | | | | | input and an output by using the '+' modifier rather than listing the operand in both the input and output sections. Reviwed by: bde Notes: svn path=/head/; revision=86301
* Add two minor changes.Mitsuru IWASAKI2001-11-111-33/+44
| | | | | | | | | - clean up wakeup routing fixup code by using macros. - allocate pte object temporary for kernel thread to avoid kernel panic by events from sleep button or lid switch. Notes: svn path=/head/; revision=86262
* Fix tab damage in rev 1.326.David E. O'Brien2001-11-061-1/+1
| | | | Notes: svn path=/head/; revision=86134
* Add S4BIOS sleep (BIOS hibernation) and DSDT overriding support.Mitsuru IWASAKI2001-11-061-1/+9
| | | | | | | | | | | | | | | | | - Add S4BIOS sleep implementation. This will works well if MIB hw.acpi.s4bios is set (and of course BIOS supports it and hibernation is enabled correctly). - Add DSDT overriding support which is submitted by takawata originally. If loader tunable acpi_dsdt_load="YES" and DSDT file is set to acpi_dsdt_name (default DSDT file name is /boot/acpi_dsdt.aml), ACPI CA core loads DSDT from given file rather than BIOS memory block. DSDT file can be generated by iasl in ports/devel/acpicatools/. - Add new files so that we can add our proposed additional code to Intel ACPI CA into these files temporary. They will be removed when similar code is added into ACPI CA officially. Notes: svn path=/head/; revision=86133
* o Add new header <sys/stdint.h>.Mike Barcroft2001-11-021-0/+220
| | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=85892
* Some fix for the recent apm module changes.Mitsuru IWASAKI2001-11-012-14/+8
| | | | | | | | | | | | | | | | | - Now that apm loadable module can inform its existence to other kernel components (e.g. i386/isa/clock.c:startrtclock()'s TCS hack). - Exchange priority of SI_SUB_CPU and SI_SUB_KLD for above purpose. - Add simple arbitration mechanism for APM vs. ACPI. This prevents the kernel enables both of them. - Remove obsolete `#ifdef DEV_APM' related code. - Add abstracted interface for Powermanagement operations. Public apm(4) functions, such as apm_suspend(), should be replaced new interfaces. Currently only power_pm_suspend (successor of apm_suspend) is implemented. Reviewed by: peter, arch@ and audit@ Notes: svn path=/head/; revision=85835
* Skip PG_UNMANAGED pages when we're shooting everything down to try andPeter Wemm2001-11-011-1/+1
| | | | | | | | | reclaim pv_entries. PG_UNMANAGED pages dont have pv_entries to reclaim. Reported by: David Xu <davidx@viasoft.com.cn> Notes: svn path=/head/; revision=85806
* Remove previous revision. smp_started back in subr_smp where it belongs.Matt Jacob2001-10-313-6/+0
| | | | Notes: svn path=/head/; revision=85793
* Make the actual volatile int smp_started live *somewhere*. This isMatt Jacob2001-10-313-0/+6
| | | | | | | | | a temporary fix so that we can compile kernels. I waited 30 minutes for a response from the person who would likely know, but any longer is too long to wait with breakage at ToT. Notes: svn path=/head/; revision=85788
* Spell deivces as devices.Robert Watson2001-10-311-1/+1
| | | | Notes: svn path=/head/; revision=85786
* Don't let pmap_object_init_pt() exhaust all available free pagesMatthew Dillon2001-10-311-1/+17
| | | | | | | | | (allocating pv entries w/ zalloci) when called in a loop due to an madvise(). It is possible to completely exhaust the free page list and cause a system panic when an expected allocation fails. Notes: svn path=/head/; revision=85762
* Don't try to probe the PnP BIOS if ACPI is active.Mike Smith2001-10-311-0/+5
| | | | Notes: svn path=/head/; revision=85761
* Add kmupetext(), a function that expands the range of memory coveredBrian Feldman2001-10-301-0/+1
| | | | | | | | | | | | by the profiler on a running system. This is not done sparsely, as memory is cheaper than processor speed and each gprof mcount() and mexitcount() operation is already very expensive. Obtained from: NAI Labs CBOSS project Funded by: DARPA Notes: svn path=/head/; revision=85733
* Move device lnc to isa section, since it no longer uses the compat shims.Warner Losh2001-10-301-3/+2
| | | | | | | | | Add comment about lnc. Remove probe order comment from isa_compat.c. That appears to no longer be the case. Notes: svn path=/head/; revision=85715
* Fix a typo in comment and #ifdef fixes: GRAP_PRIO -> GRAB_PRIO so thatJohn Baldwin2001-10-302-2/+2
| | | | | | | | | | x86 SMP kernels actually boot again to single user mode. Pointy hat to: jhb Noticed by: jlemon Notes: svn path=/head/; revision=85711
* Don't set CR0_NE in cpu_setregs() for the SMP case, since setting itBruce Evans2001-10-291-0/+2
| | | | | | | | | | is npx.c's job and setting it here breaks the edit-time option of not setting it in npx.c. (It is not set in the right places for the SMP case, but always setting it here is harmless because there isn't even an edit-time option to not set it.) Notes: svn path=/head/; revision=85695
* - More whitespace and comment cleanups.John Baldwin2001-10-282-70/+92
| | | | | | | | | | | - Remove unused sw1a label. A breakpoint can be set in choosethread() for the same effect. Reviewed by: bde Submitted by: bde (partly) Notes: svn path=/head/; revision=85627
* Add APM compatibility feature to ACPI.Mitsuru IWASAKI2001-10-261-0/+335
| | | | | | | | | | | | | | | | | | | | This emulates APM device node interface APIs (mainly ioctl) and provides APM services for the applications. The goal is to support most of APM applications without any changes. Implemented ioctls in this commit are: - APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl) - APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl) - APMIO_GETINFO and APMIO_GETINFO_OLD - APMIO_GETPWSTATUS With above, many APM applications which get batteries, ac-line info. and transition the system into suspend/standby mode (such as wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-) Reviewed by: arch@, audit@ and some guys Notes: svn path=/head/; revision=85556
* Add a per-thread ucred reference for syscalls and synchronous traps fromJohn Baldwin2001-10-261-26/+37
| | | | | | | | | | | | userland. The per thread ucred reference is immutable and thus needs no locks to be read. However, until all the proc locking associated with writes to p_ucred are completed, it is still not safe to use the per-thread reference. Tested on: x86 (SMP), alpha, sparc64 Notes: svn path=/head/; revision=85525
* Currently no code does a CROSSJUMP() to sw1a, so we don't need aJohn Baldwin2001-10-252-4/+0
| | | | | | | | | CROSSJUMPTARGET() for it. Submitted by: bde Notes: svn path=/head/; revision=85491
* Use %ecx instead of %ebx for the scratch register while updating %dr7 sinceJohn Baldwin2001-10-252-10/+6
| | | | | | | | | | %ecx isn't a call safe register and thus we don't have to save and restore it. Submitted by: bde Notes: svn path=/head/; revision=85490