summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Make the style a little bit more consistant by removing parametermarkm2002-02-031-3/+2
| | | | | names from some prototypes. (Other prototypes here already have these removed).
* Use osigreturn(2) instead of sigreturn(2) plus broken magic for returningbde2002-02-033-13/+12
| | | | | | | | | | | | | | | | | | from old signal handlers. This is simpler and faster, and fixes (new) sigreturn(2) when %eip in the new signal context happens to match the magic value (0x1d516). 0x1d516 is below the default ELF text section, so this probably never broken anything in practice. locore.s: In addition, don't build the signal trampoline for old signal handlers when it is not used. alpha: Not fixed, but seems to be even less broken in practice due to more advanced magic. A false match occurs for register #32 in mc_regs[]. Since there is no hardware register #32, a false match is only possible for direct calls to sigreturn(2) that happen to have the magic number in the spare mc_regs[32] field.
* Improve the change in the previous commit: use a stub for osigreturn()bde2002-02-031-0/+4
| | | | when it is not really used instead of unconditionalizing all of it.
* Compile osigreturn() unconditionally since it will always be needed onbde2002-02-011-2/+0
| | | | | | | | | | | | | | | | | | some arches and the syscall table is machine-independent. It was (bogusly) conditional on COMPAT_43, so this usually makes no difference. ia64: in addition: - replace the bogus cloned comment before osigreturn() by a correct one. osigreturn() is just a stub fo ia64's. - fix the formatting of cloned comment before sigreturn(). - fix the return code. use nosys() instead of returning ENOSYS to get the same semantics as if the syscall is not in the syscall table. Generating SIGSYS is actually correct here. - fix style bugs. powerpc: copy the cleaned up ia64 stub. This mainly fixes a bogus comment. sparc64: copy the cleaned up the ia64 stub, since there was no stub before.
* Finish revs.1.23 and 1.24 so that MCOUNT_ENTER really actually compilesbde2002-01-311-0/+1
| | | | | | | | | for SMP in the plain profiling case. It seems to work too. This error was not detected by LINT because LINT only compiles the GUPROF profiling case, which is is a superset of the plain profiling case for !SMP but which is so broken for SMP that the buggy code is not compiled.
* Backed out the main part of revs.1.14-16. Don't disable interrupts inbde2002-01-301-10/+3
| | | | | | | | the packet transfer routines, since rev.1.468 of machdep.c does this better. I'm surprised that disabling interrupts helped much. Disabling them in the packet receive routine is too late. Fixed some minor style bugs in rev.1.14.
* Backed out the last vestiges of rev.1.51. Don't enter a criticalbde2002-01-301-10/+1
| | | | | region in Debugger(), since rev.1.468 of machdep.c does this better. Other cosmetic backouts.
* Cleaned up the 0ldSiG magic check before removing it. Just use fuword()bde2002-01-301-13/+8
| | | | | | | | | | | | | | | to fetch the magic word instead of useracc() plus a direct access. This is more efficient as well as simpler and less incorrect: - it was inefficent because useracc() takes much longer than just accessing the data using a correct access method, at least on i386's. - it was incorrect because direct access is incorrect unless the address has been mapped. This and nearby direct accesses are mostly handled better for other arches because they have to be (direct accesses don't work). - using magic in sigreturn is still fundamentally broken because false matches are possible. On i386's, a false match occurs when %eip in a new signal context happens to equal the magic value. This is not handled better for other arches.
* Don't include <isa/isavar.h> or compile code depending on it when isabde2002-01-309-2/+42
| | | | | | | | is not configured. Including <isa/isavar.h> when it is not used is harmful as well as bogus, since it includes "isa_if.h" which is not generated when isa is not configured. This was fixed in 1999 but was broken by unconditionalizing PNPBIOS.
* Removed unused includes. In particular, don't include <isa/isavar.h> sincebde2002-01-301-24/+2
| | | | | | its only effect is to break the optionality of the isa option. Sorted includes.
* List bit 18 (reserved, apparently present on thunderbird cpus)peter2002-01-221-2/+2
| | | | | | and bit 19 (athlon XP/MP rev 0x662 and later) for amd_features. Submitted by: dwcjr
* Add the 'iir' driver, for the Intel Integrated RAID controllers andmsmith2002-01-201-0/+2
| | | | | | | | prior ICP Vortex models. This driver was developed by Achim Leubner of Intel (previously with ICP Vortex) and Boji Kannanthanam of Intel. Submitted by: "Kannanthanam, Boji T" <boji.t.kannanthanam@intel.com> MFC after: 2 weeks
* The Libretto L series has no $PIR table, but does have a _PIR table.imp2002-01-201-13/+22
| | | | | | | | | | | | | This typo keeps us from properly routing an interrupt for CardBus bridges on this machine. So, now we look for $PIR and then _PIR to cope. With these changes, the Libretto L1 now works properly. Evidentally, the idea comes from patch that the Japanese version of RedHat (or against a Japanese version of Red Hat), but my Japanese isn't good enough to to know for sure. Reported by: Hiroyuki Aizu-san <eyes@navi.org> # This may be an MFC candidate, but I'm not yet sure.
* Avoid __func__ string concatenationpeter2002-01-183-12/+12
|
* Changed the type of pcb_flags from u_char to u_int and adjusted things.bde2002-01-173-11/+7
| | | | | This removes the only atomic operation on a char type in the entire kernel.
* Change <b28> to HTT (Hyperthreading technology). If this flag is set thenpeter2002-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).
* Ensure that we set all the %cr0 bits to a known state for the AP's beforepeter2002-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).
* Clear the single-step flag for signal handlers. This fixes bogus tracebde2002-01-102-7/+7
| | | | | | | | | | | | | | | | 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
* Fix typo in function name.wes2002-01-101-1/+1
| | | | | Reviewed by: peter@ Obtained from: mux@sneakerz.org
* Use a spare slot in the machine context for a flags word to indicatedeischen2002-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
* Fix S3 breakage.takawata2002-01-091-1/+2
| | | | | Now AcpiEnterSleep() is light enough, so flushing cache before the function is not too early.
* Staticise devclasses and some unnecessarily global variables.msmith2002-01-081-1/+1
|
* Convert a bunch of 1 << PCPU_GET(cpuid) to PCPU_GET(cpumask).peter2002-01-054-9/+9
|
* Change the preemption code for software interrupt thread schedules andjhb2002-01-055-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow a specific setting for pv entries. This avoids the need to guesspeter2002-01-031-0/+1
| | | | | (or calculate by hand) the effect of interactions between shpgperproc, physical ram size, maxproc, maxdsiz, etc.
* Grrr. The tlb code is strewn over 3 files and I misread it. Revertdillon2001-12-311-8/+0
| | | | | the last change (it was a NOP), and remove the XXX comments that no longer apply.
* You know those 'XXX what about SMP' comments in pmap_kenter()? Well,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
* GC an alternate trap_pfault() which has rotted away behind an "#ifdef notyet"phk2001-12-301-118/+0
| | | | since 21-Mar-95 .
* Use the new resource_list_print_type() function.tmm2001-12-211-1/+1
| | | | | Pass the bus device to isa_init() (this is needed for the sparc64 version).
* Introduce a standard name for the lock protecting an interrupt controllerjhb2001-12-2015-67/+74
| | | | | | | | 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.
* Replace a bunch of:peter2001-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) {
* Fix some whitespace nits, and a minor error that I made in some unusedpeter2001-12-201-8/+7
| | | | #ifdef DEBUG code (VM_MAXUSER_ADDRESS vs UPT_MAX_ADDRESS).
* Axe stale extern for a non-existent variable.jhb2001-12-181-1/+0
|
* In a couple of places, we recalculated addresses we already had in localjulian2001-12-181-3/+3
| | | | pointer variables.
* Various assembly fixes mostly in the form of using the "+" modifier forjhb2001-12-181-14/+14
| | | | | | | output operands to mark them as both input and output rather than listing operands twice. Reviewed by: bde
* Allow the ATOMIC_ASM() macro to pass in the constraints on the V parameterjhb2001-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
* Modify the critical section API as follows:jhb2001-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
* Small cleanups to the SMP code:jhb2001-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.
* Device Polling code for -current.luigi2001-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
* Enable UFS_DIRHASH in the GENERIC kernel.iedowse2001-12-141-0/+1
| | | | | | Suggested by: silby Reviewed by: dillon MFC after: 5 days
* Fixed to draw mouse cursor. The syscons driver for PC98 uses differentnyan2001-12-141-0/+5
| | | | | | | attributes from i386. Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata) MFC after: 3 days
* Axe an unneeded PCPU_SET(spinlocks, NULL) that I missed earlier.jhb2001-12-123-3/+0
|
* Overhaul the per-CPU support a bit:jhb2001-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
* Delete some leftover code from a bygone age. We dont have an array ofpeter2001-12-111-11/+1
| | | | IdlePTDS anymore and dont to the PTD[MPPTDI] swapping etc.
* Add new boot flag to i386 boot: -p.guido2001-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
* Add identification string for AMD-761 host to PCI bridge.murray2001-12-101-0/+3
| | | | PR: kern/32255
* Allow maxusers to be specified as 0 in the kernel config, which willdillon2001-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
* Update pathnames for creation of tags file.mckusick2001-12-051-1/+1
|
* PROCFS requires PSEUDOFS. I forgot that GENERIC didn't have PSEUDOFS yet.des2001-12-041-1/+2
|
* Add a missing open paren to a macro that's been broken (and apparentlyjhb2001-12-041-1/+1
| | | | | | unused) since rev 1.1 so it is at least correct. Submitted by: Maxime Henrion <mux@qualys.com>
OpenPOWER on IntegriCloud