summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
Commit message (Collapse)AuthorAgeFilesLines
* Define ovbcopy() as a macro which expands to the equivalent bcopy() call,des2003-04-041-4/+5
| | | | | | | | | | | | | | to take care of the KAME IPv6 code which needs ovbcopy() because NetBSD's bcopy() doesn't handle overlap like ours. Remove all implementations of ovbcopy(). Previously, bzero was a function pointer on i386, to save a jmp to bzero_vector. Get rid of this microoptimization as it only confuses things, adds machine-dependent code to an MD header, and doesn't really save all that much. This commit does not add my pagezero() / pagecopy() code.
* Bandaid fix for previous commit while I figure out why it broke. Thisjake2003-04-041-2/+2
| | | | | | | caused crashes early in boot on i386 UP machines. Reported by: phk Pointy hat to: jake
* - Removed APTD and associated macros, it is no longer used.jake2003-04-031-9/+7
| | | | | | BANG BANG BANG etc. Sponsored by: DARPA, Network Associates Laboratories
* Commit a partial lazy thread switch mechanism for i386. it isn't as lazypeter2003-04-024-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as it could be and can do with some more cleanup. Currently its under options LAZY_SWITCH. What this does is avoid %cr3 reloads for short context switches that do not involve another user process. ie: we can take an interrupt, switch to a kthread and return to the user without explicitly flushing the tlb. However, this isn't as exciting as it could be, the interrupt overhead is still high and too much blocks on Giant still. There are some debug sysctls, for stats and for an on/off switch. The main problem with doing this has been "what if the process that you're running on exits while we're borrowing its address space?" - in this case we use an IPI to give it a kick when we're about to reclaim the pmap. Its not compiled in unless you add the LAZY_SWITCH option. I want to fix a few more things and get some more feedback before turning it on by default. This is NOT a replacement for Bosko's lazy interrupt stuff. This was more meant for the kthread case, while his was for interrupts. Mine helps a little for interrupts, but his helps a lot more. The stats are enabled with options SWTCH_OPTIM_STATS - this has been a pseudo-option for years, I just added a bunch of stuff to it. One non-trivial change was to select a new thread before calling cpu_switch() in the first place. This allows us to catch the silly case of doing a cpu_switch() to the current process. This happens uncomfortably often. This simplifies a bit of the asm code in cpu_switch (no longer have to call choosethread() in the middle). This has been implemented on i386 and (thanks to jake) sparc64. The others will come soon. This is actually seperate to the lazy switch stuff. Glanced at by: jake, jhb
* - Add support for PAE and more than 4 gigs of ram on x86, dependent on thejake2003-03-303-6/+74
| | | | | | | | | | kernel opition 'options PAE'. This will only work with device drivers which either use busdma, or are able to handle 64 bit physical addresses. Thanks to Lanny Baron from FreeBSD Systems for the loan of a test machine with 6 gigs of ram. Sponsored by: DARPA, Network Associates Laboratories, FreeBSD Systems
* - Remove invalid casts.jake2003-03-301-1/+1
| | | | Sponsored by: DARPA, Network Associates Laboratories
* - Convert all uses of pmap_pte and get_ptbase to pmap_pte_quick. Whenjake2003-03-301-1/+1
| | | | | | | | | | | | accessing an alternate address space this causes 1 page table page at a time to be mapped in, rather than using the recursive mapping technique to map in an entire alternate address space. The recursive mapping technique changes large portions of the address space and requires global tlb flushes, which seem to cause problems when PAE is enabled. This will also allow IPIs to be avoided when mapping in new page table pages using the same technique as is used for pmap_copy_page and pmap_zero_page. Sponsored by: DARPA, Network Associates Laboratories
* Nuke options HTT infavor of machdep.hlt_logical_cpus tunable/sysctl.ps2003-03-262-21/+89
| | | | | | | | | | | | | | This keeps the logical cpu's halted in the idle loop. By default the logical cpu's are halted at startup. It is also possible to halt any cpu in the idle loop now using machdep.hlt_cpus. Examples of how to use this: machdep.hlt_cpus=1 halt cpu0 machdep.hlt_cpus=2 halt cpu1 machdep.hlt_cpus=4 halt cpu2 machdep.hlt_cpus=3 halt cpu0,cpu1 Reviewed by: jhb, peter
* - Add vm_paddr_t, a physical address type. This is required for systemsjake2003-03-254-11/+13
| | | | | | | | | | | | | | | where physical addresses larger than virtual addresses, such as i386s with PAE. - Use this to represent physical addresses in the MI vm system and in the i386 pmap code. This also changes the paddr parameter to d_mmap_t. - Fix printf formats to handle physical addresses >4G in the i386 memory detection code, and due to kvtop returning vm_paddr_t instead of u_long. Note that this is a name change only; vm_paddr_t is still the same as vm_offset_t on all currently supported platforms. Sponsored by: DARPA, Network Associates Laboratories Discussed with: re, phk (cdevsw change)
* Expand the APIC ID mask field of the ICR register to 8 bits intead of justjhb2003-03-171-1/+1
| | | | | | | | | 4 bits. This reportedly fixes booting on the SW7500CW2. Much thanks to the submitter for tracking this down! Submitted by: Brian Buchanan <brian@ncircle.com> Reviewed by: peter MFC after: 3 days
* Made the prototypes for pmap_kenter and pmap_kremove MD. These functionsjake2003-03-161-0/+2
| | | | | | | | | are machine dependent because they are not required to update the tlb when mappings are added or removed, and doing so is machine dependent. In addition, an implementation may require that pages mapped with pmap_kenter have a backing vm_page_t, which is not necessarily true of all physical pages, and so may choose to pass the vm_page_t to pmap_kenter instead of the physical address in order to make this requirement clear.
* Use bus_space_handle_t to represent host port and virtual addresses;jake2003-03-112-24/+24
| | | | | | bus_addr_t may not be appropriate. Sponsored by: DARPA, Network Associates Laboratories
* Wrap the hyperthreading support code with the HTT kernel option.jhb2003-03-041-0/+21
| | | | | | Hyperthreading support is now off unless the HTT option is added. MFC-after: 3 days
* Remove some long unused declarations. (For example, the PV flags have notalc2003-02-271-6/+0
| | | | been used since revision 1.8, roughly nine years ago.)
* Correctly set BUS_SPACE_MAXSIZE in all the busdma backends.mux2003-02-262-2/+2
| | | | | It was bogusly set to 64 * 1024 or 128 * 1024 because it was bogusly reused in the BUS_DMAMAP_NSEGS definition.
* - Added inlines pmap_is_current, pmap_is_alternate and pmap_set_alternatejake2003-02-251-1/+1
| | | | | | | | for testing and setting the current and alternate address spaces. - Changed PTDpde and APTDpde to arrays to support multiple page directory pages. ponsored by: DARPA, Network Associates Laboratories
* - Removed UMAXPTDI and UMAXPTEOFF.jake2003-02-242-3/+1
| | | | | | | | | - Changed VM_MAXUSER_ADDRESS to be defined in terms of PTDPTDI. In order for assumptions about the recursive page table map to work it must be the base of the recursive map. Any pte offset that's not NPTEPG will break these assumptions. Sponsored by: DARPA, Network Associates Laboratories
* The mpbiosreason variable does not used for pc98.nyan2003-02-241-0/+2
|
* Allow machines with one CPU and a valid mp table to boot an SMP kernel.tegge2003-02-231-0/+2
|
* Previous commit missed a 1 that should be NGPTD, and an NPDEPG that shouldjake2003-02-231-1/+1
| | | | | | be NPDEPTD. Grumble. Sponsored by: DARPA, Network Associates Laboratories
* - Added macros NPGPTD, NBPTD, and NPDEPTD, for dealing with the size of thejake2003-02-231-4/+4
| | | | | | | | | page directory. - Use these instead of the magic constants 1 or PAGE_SIZE where appropriate. There are still numerous assumptions that the page directory is exactly 1 page. Sponsored by: DARPA, Network Associates Laboratories
* - Added macros PDESHIFT and PTESHIFT, use these instead of magic constantsjake2003-02-231-2/+2
| | | | | | | in locore. - Removed the macros PTESIZE and PDESIZE, use sizeof instead in C. Sponsored by: DARPA, Network Associates Laboratories
* The root of the splay tree maintained within the pm_pteobj always refersalc2003-02-221-1/+0
| | | | | to the last accessed pte page. Thus, the pm_ptphint is redundant and can be removed.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-4/+4
| | | | Approved by: trb
* Initiate de-orbit burn for USE_PCI_BIOS_FOR_READ_WRITE. This has beenpeter2003-02-181-2/+0
| | | | | | | | | | | | | | #if'ed out for a while. Complete the deed and tidy up some other bits. We need to be able to call this stuff from outer edges of interrupt handlers for devices that have the ISR bits in pci config space. Making the bios code mpsafe was just too hairy. We had also stubbed it out some time ago due to there simply being too much brokenness in too many systems. This adds a leaf lock so that it is safe to use pci_read_config() and pci_write_config() from interrupt handlers. We still will use pcibios to do interrupt routing if there is no acpi.. [yes, I tested this] Briefly glanced at by: imp
* Remove #include <sys/dkstat.h>phk2003-02-161-1/+0
|
* Implement fpclassify():mike2003-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a MD header private to libc called _fpmath.h; this header contains bitfield layouts of MD floating-point types. o Add a MI header private to libc called fpmath.h; this header contains bitfield layouts of MI floating-point types. o Add private libc variables to lib/libc/$arch/gen/infinity.c for storing NaN values. o Add __double_t and __float_t to <machine/_types.h>, and provide double_t and float_t typedefs in <math.h>. o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF, HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via <machine/float.h>. o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based on the size of its argument. __fpclassifyl() is never called on alpha because (sizeof(long double) == sizeof(double)), which is good since __fpclassifyl() can't deal with such a small `long double'. This was developed by David Schultz and myself with input from bde and fenner. PR: 23103 Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU> (significant portions) Reviewed by: bde, fenner (earlier versions)
* i386/i386/tsc.c was repo-copied from i386/isa/clock.c.phk2003-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Remove all the stuff that does not relate to the TSC. Change the calibration to use DELAY(1000000) rather than trying to check it against the CMOS RTC, this drastically increases precision: Using 25 samples on a Athlon 700MHz UP machine I find: stddev min max average CMOS 22200 Hz -74980 Hz 34301 Hz 704928721 Hz DELAY 1805 Hz -1984 Hz 2678 Hz 704937583 Hz (The difference between the two averages is not statistically significant.) expressed in PPM of the frequency: stddev min max CMOS 31.49 PPM -106.37 PPM 48.66 PPM DELAY 2.56 PPM 2.81 PPM 3.80 PPM This code will not be used until a followup commit to sys/isa/clock.c and sys/pc98/pc98/clock.c which will only happen after some field testing.
* Make get_cyclecount() use binuptime() when no tsc is available: it is cheaper.phk2003-02-051-4/+4
|
* Split statclock into statclock and profclock, and made the method for drivingjake2003-02-033-12/+13
| | | | | | | | | | | | | statclock based on profhz when profiling is enabled MD, since most platforms don't use this anyway. This removes the need for statclock_process, whose only purpose was to subdivide profhz, and gets the profiling clock running outside of sched_lock on platforms that implement suswintr. Also changed the interface for starting and stopping the profiling clock to do just that, instead of changing the rate of statclock, since they can now be separate. Reviewed by: jhb, tmm Tested on: i386, sparc64
* Reversion of commit by Davidxu plus fixes since applied.julian2003-02-011-1/+2
| | | | | | | | I'm not convinced there is anything major wrong with the patch but them's the rules.. I am using my "David's mentor" hat to revert this as he's offline for a while.
* Make tsc_freq a 64bit quantity.phk2003-01-291-1/+1
| | | | Inspired by: http://www.theinquirer.net/?article=7481
* Implement bus_dmamem_alloc_size() and bus_dmamem_free_size() asscottl2003-01-291-0/+6
| | | | | | | | | | | | | | | | | | | | counterparts to bus_dmamem_alloc() and bus_dmamem_free(). This allows the caller to specify the size of the allocation instead of it defaulting to the max_size field of the busdma tag. This is intended to aid in converting drivers to busdma. Lots of hardware cannot understand scatter/gather lists, which forces the driver to copy the i/o buffers to a single contiguous region before sending it to the hardware. Without these new methods, this would require a new busdma tag for each operation, or a complex internal allocator/cache for each driver. Allocations greater than PAGE_SIZE are rounded up to the next PAGE_SIZE by contigmalloc(), so this is not suitable for multiple static allocations that would be better served by a single fixed-length subdivided allocation. Reviewed by: jake (sparc64)
* Remove BDE_DEBUGGER.jake2003-01-281-4/+0
| | | | Discussed with: bde
* Fix KSE related patch.julian2003-01-261-2/+1
| | | | | Make it compile for the SMP case.. statclock_process() has changed prototypes.
* Nuke CHEAP_TPR stuff, including LOPRIO_LEVEL (bogus) and ALLHWI_LEVELpeter2003-01-231-17/+0
| | | | | (which we never used). There is no need to tweak the TPR anymore and only causes problems.
* - Move enable_sse()'s prototype to machine/md_var.h.jhb2003-01-222-4/+3
| | | | | | | | - Sort definition of cpu_* variables appropriately. - Move cpu_fxsr out of the magic non-BSS set of variables and stick it in the BSS along with hw_instruction_sse (make the latter static as well). Submitted by: bde (partially)
* Rename cpuid_cpuinfo to cpu_procinfo. bde requested that I rename thisjhb2003-01-222-2/+2
| | | | | | | variable to something in the cpu_* namespace since that's what all the other cpuid variables were named and cpu_procinfo is what I came up with. Requested by: bde
* Bah, add in a missing space char I noticed when MFC'ing this.jhb2003-01-221-1/+1
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* o Move the contents of <machine/floatingpoint.h> over tomarcel2003-01-192-88/+80
| | | | | | | | | | | | | | | <machine/ieeefp.h> where it belongs. o Remove the i386 specific inclusion of <machine/floatingpoint.h> from <ieeefp.h>, now that including <machine/ieeefp.h> is enough for all architectures. o Allow <machine/ieeefp.h> to inline the functions exposed by the headers by checking for _IEEEFP_INLINED_ in the MI header. When defined, prototypes are not given and it is assumed that the MD headers, when inlining only a subset of the functions provide prototypes for the functions not being inlined. Based on patch from: Terry Lambert <tlambert2@mindspring.com> Tested with: make release.
* Rework part of the previous processor name changes so that we readjhb2003-01-091-1/+0
| | | | | | | | cpu_exthigh and cpu_brand in printcpuinfo() instead of in identify_cpu(). We also only do it for known-good values of cpu_vendor which is a bit more conservative. Reviewed by: bde (mostly)
* - Add a cpu_exthigh variable to hold the highest extended cpuid valuejhb2003-01-081-0/+2
| | | | | | | | | returned from cpuid 0x80000000. - Add a cpu_brand char array to hold the processor name returned by cpuid 0x80000002-0x80000004 on AMD, Intel, Transmeta, and possibly other CPUs. - Use cpuid to set cpu_exthigh and read the processor name if it is present in identify_cpu().
* Enumerate logical hyperthread CPUs manually if they aren't already listedjhb2003-01-081-0/+80
| | | | | | | | | | | | | | | | in the mptable. The way this works is that we determine if the system has hyperthreading and how many logical CPU's should be in each physical CPU by using the information returned by cpuid. During the first pass of the mptable, we build a bitmask of the APIC IDs of the CPUs listed in the mptable. We then scan that bitmask to see if the CPUs are already listed by the mptable, or if there are any APIC IDs already in use that would conflict with the APIC IDs of the logical CPUs. If that test succeeds, then we fixup the count of application processors. Later on during the second pass of the mptable we create fake processor entries for logical CPUs and add them to the system. We only need this type of fixup hack when using the mptable to enumerate CPUs. The ACPI MADT table properly enumerates all logical CPUs.
* Add a cpuid_cpuinfo variable to hold the results of %ebx from cpuid withjhb2003-01-081-0/+1
| | | | %eax of 1 and set it in identify_cpu().
* - Fix the name of the hyperthreading cpuid feature flag to be HTT insteadjhb2003-01-081-1/+9
| | | | | of HHT. - Document fields returned in %ebx by a cpuid with %eax of 1.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-012-4/+4
| | | | especially in troff files.
* MB_LEN_MAX is not MD, move it to the MI limits.h.tjr2002-12-222-2/+0
|
* Align the FPU state in the ucontext and sigcontext to 16 bytesdeischen2002-12-022-6/+8
| | | | | | | | | to accomodate the new SSE/XMM floating point save/restore instructions. This commit is mostly from bde and includes some style nits. Approved by: re (jhb)
* Add getcontext, setcontext, and swapcontext as system calls.deischen2002-11-162-12/+5
| | | | | | | | | | | Previously these were libc functions but were requested to be made into system calls for atomicity and to coalesce what might be two entrances into the kernel (signal mask setting and floating point trap) into one. A few style nits and comments from bde are also included. Tested on alpha by: gallatin
OpenPOWER on IntegriCloud