aboutsummaryrefslogtreecommitdiff
path: root/sys/pc98
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge amd64 and i386 bus.h and move the resulting header to x86. ReplaceTijl Coosemans2010-12-201-2/+2
| | | | | | | | | | | | the original amd64 and i386 headers with stubs. Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere. Reviewed by: imp (previous version), jhb Approved by: kib (mentor) Notes: svn path=/head/; revision=216592
* Do not subtract 0.5% from estimated frequency if DELAY(9) is driven by TSC.Jung-uk Kim2010-12-081-3/+7
| | | | | | | Remove a confusing comment about converting to MHz as we never did. Notes: svn path=/head/; revision=216312
* Revert r216134. This checkin broke platforms where bus_space are macros:Rebecca Cran2010-12-031-9/+7
| | | | | | | | they need to be a single statement, and do { } while (0) doesn't work in this situation so revert until a solution can be devised. Notes: svn path=/head/; revision=216143
* Disallow passing in a count of zero bytes to the bus_space(9) functions.Rebecca Cran2010-12-021-7/+9
| | | | | | | | | | | | Passing a count of zero on i386 and amd64 for [I386|AMD64]_BUS_SPACE_MEM causes a crash/hang since the 'loop' instruction decrements the counter before checking if it's zero. PR: kern/80980 Discussed with: jhb Notes: svn path=/head/; revision=216134
* Remove npxgetregs(), npxsetregs(), fpugetregs() and fpusetregs()Konstantin Belousov2010-11-261-77/+26
| | | | | | | | | | | | | | | | | | | functions, they are unused. Remove 'user' from npxgetuserregs() etc. names. For {npx,fpu}{get,set}regs(), always use pcb->pcb_user_save for FPU context storage. This eliminates the need for ugly copying with overwrite of the newly added and reserved fields in ucontext on i386 to satisfy alignment requirements for fpusave() and fpurstor(). pc98 version was copied from i386. Suggested and reviewed by: bde Tested by: pho (i386 and amd64) MFC after: 1 week Notes: svn path=/head/; revision=215865
* Include x86/_align.h directly instead of including the i386 header.Tijl Coosemans2010-11-261-26/+3
| | | | | | | Approved by: kib (mentor) Notes: svn path=/head/; revision=215863
* Move identical copies of apm_bios.h to sys/x86/include, replace them withJung-uk Kim2010-11-111-1/+1
| | | | | | | | | stubs, and adjust PC98 stub accordingly. Reviewed by: imp, nyan Notes: svn path=/head/; revision=215140
* - Remove <machine/mutex.h>. Most of the headers were empty, and theJohn Baldwin2010-11-091-6/+0
| | | | | | | | | | | | | | | contents of the ones that were not empty were stale and unused. - Now that <machine/mutex.h> no longer exists, there is no need to allow it to override various helper macros in <sys/mutex.h>. - Rename various helper macros for low-level operations on mutexes to live in the _mtx_* or __mtx_* namespaces. While here, change the names to more closely match the real API functions they are backing. - Drop support for including <sys/mutex.h> in assembly source files. Suggested by: bde (1, 2) Notes: svn path=/head/; revision=215054
* Move the mptable.h under x86/include/.Attilio Rao2010-11-091-6/+0
| | | | | | | | Sponsored by: Sandvine Incorporated MFC after: 14 days Notes: svn path=/head/; revision=215051
* Adjust the order of operations in spinlock_enter() and spinlock_exit() toJohn Baldwin2010-11-051-4/+10
| | | | | | | | | | | | | | | | | | | | | work properly with single-stepping in a kernel debugger. Specifically, these routines have always disabled interrupts before increasing the nesting count and restored the prior state of interrupts after decreasing the nesting count to avoid problems with a nested interrupt not disabling interrupts when acquiring a spin lock. However, trap interrupts for single-stepping can still occur even when interrupts are disabled. Now the saved state of interrupts is not saved in the thread until after interrupts have been disabled and the nesting count has been increased. Similarly, the saved state from the thread cannot be read once the nesting count has been decreased to zero. To fix this, use temporary variables to store interrupt state and shuffle it between the thread's MD area and the appropriate registers. In cooperation with: bde MFC after: 1 month Notes: svn path=/head/; revision=214835
* Move <machine/apicreg.h> to <x86/apicreg.h>.John Baldwin2010-11-011-6/+0
| | | | Notes: svn path=/head/; revision=214631
* Move the <machine/mca.h> header to <x86/mca.h>.John Baldwin2010-11-012-7/+1
| | | | Notes: svn path=/head/; revision=214630
* Rename BUS_SPACE_IO and BUS_SPACE_MEM defines to BUS_SPACE_TAG_IO andYoshihiro Takahashi2010-10-312-10/+10
| | | | | | | BUS_SPACE_TAG_MEM respectively to avoid conflict with nexus.c. Notes: svn path=/head/; revision=214584
* MFi386: the part of revision 213226.Yoshihiro Takahashi2010-10-241-44/+55
| | | | | | | | | | Rewrite the i386 memory probe: - Move the base memory setup into a new basemem_setup() routine. MFC after: 1 week Notes: svn path=/head/; revision=214258
* Remove trailing ", " from `sysctl machdep.idle_available' output.Jung-uk Kim2010-10-121-1/+2
| | | | Notes: svn path=/head/; revision=213748
* Now userland POSIX semaphore is based on umtx. The kernel moduleDavid Xu2010-09-241-1/+0
| | | | | | | | is only used to support binary compatible, if want to run old binary, you need to kldload the module. Notes: svn path=/head/; revision=213098
* Refactor timer management code with priority to one-shot operation mode.Alexander Motin2010-09-131-59/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main goal of this is to generate timer interrupts only when there is some work to do. When CPU is busy interrupts are generating at full rate of hz + stathz to fullfill scheduler and timekeeping requirements. But when CPU is idle, only minimum set of interrupts (down to 8 interrupts per second per CPU now), needed to handle scheduled callouts is executed. This allows significantly increase idle CPU sleep time, increasing effect of static power-saving technologies. Also it should reduce host CPU load on virtualized systems, when guest system is idle. There is set of tunables, also available as writable sysctls, allowing to control wanted event timer subsystem behavior: kern.eventtimer.timer - allows to choose event timer hardware to use. On x86 there is up to 4 different kinds of timers. Depending on whether chosen timer is per-CPU, behavior of other options slightly differs. kern.eventtimer.periodic - allows to choose periodic and one-shot operation mode. In periodic mode, current timer hardware taken as the only source of time for time events. This mode is quite alike to previous kernel behavior. One-shot mode instead uses currently selected time counter hardware to schedule all needed events one by one and program timer to generate interrupt exactly in specified time. Default value depends of chosen timer capabilities, but one-shot mode is preferred, until other is forced by user or hardware. kern.eventtimer.singlemul - in periodic mode specifies how much times higher timer frequency should be, to not strictly alias hardclock() and statclock() events. Default values are 2 and 4, but could be reduced to 1 if extra interrupts are unwanted. kern.eventtimer.idletick - makes each CPU to receive every timer interrupt independently of whether they busy or not. By default this options is disabled. If chosen timer is per-CPU and runs in periodic mode, this option has no effect - all interrupts are generating. As soon as this patch modifies cpu_idle() on some platforms, I have also refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions (if supported) under high sleep/wakeup rate, as fast alternative to other methods. It allows SMP scheduler to wake up sleeping CPUs much faster without using IPI, significantly increasing performance on some highly task-switching loads. Tested by: many (on i386, amd64, sparc64 and powerc) H/W donated by: Gheorghe Ardelean Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=212541
* bus_add_child: change type of order parameter to u_intAndriy Gapon2010-09-101-2/+2
| | | | | | | | | | | | | This reflects actual type used to store and compare child device orders. Change is mostly done via a Coccinelle (soon to be devel/coccinelle) semantic patch. Verified by LINT+modules kernel builds. Followup to: r212213 MFC after: 10 days Notes: svn path=/head/; revision=212413
* Add MALLOC_DEBUG_MAXZONES debug malloc(9) option to use multiple umaMatthew D Fleming2010-07-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | zones for each malloc bucket size. The purpose is to isolate different malloc types into hash classes, so that any buffer overruns or use-after-free will usually only affect memory from malloc types in that hash class. This is purely a debugging tool; by varying the hash function and tracking which hash class was corrupted, the intersection of the hash classes from each instance will point to a single malloc type that is being misused. At this point inspection or memguard(9) can be used to catch the offending code. Add MALLOC_DEBUG_MAXZONES=8 to -current GENERIC configuration files. The suggestion to have this on by default came from Kostik Belousov on -arch. This code is based on work by Ron Steinke at Isilon Systems. Reviewed by: -arch (mostly silence) Reviewed by: zml Approved by: zml (mentor) Notes: svn path=/head/; revision=210564
* Store fsbase and gsbase in the right fields of the mcontext. They wereTijl Coosemans2010-07-201-4/+4
| | | | | | | | | | | switched. PR: i386/148344 Approved by: kib (mentor) MFC after: 1 week Notes: svn path=/head/; revision=210294
* Unify pc98 event timer code with the rest of x86.Alexander Motin2010-07-132-563/+4
| | | | | | | Reviewed by: nyan@ Notes: svn path=/head/; revision=209979
* Move prototypes for kern_sigtimedwait() and kern_sigprocmask() toJohn Baldwin2010-06-301-0/+1
| | | | | | | <sys/syscallsubr.h> where all other kern_<syscall> prototypes live. Notes: svn path=/head/; revision=209613
* Fix bugs on pc98, use npxgetuserregs() instead of npxgetregs() forKonstantin Belousov2010-06-231-11/+8
| | | | | | | | | | | | | get_fpcontext(), and npxsetuserregs() for set_fpcontext). Also, note that usercontext is not initialized anymore in fpstate_drop(). Systematically replace references to npxgetregs() and npxsetregs() by npxgetuserregs() and npxsetuserregs() in comments. Noted by: bde Notes: svn path=/head/; revision=209463
* After the FPU use requires #MF working due to INT13 FPU exception handlingKonstantin Belousov2010-06-231-3/+2
| | | | | | | | | | | | removal, MFi386 r209198: Use critical sections instead of disabling local interrupts to ensure the consistency between PCPU fpcurthread and the state of FPU. Reviewed by: bde Tested by: pho Notes: svn path=/head/; revision=209462
* Remove the support for int13 FPU exception reporting on i386. It isKonstantin Belousov2010-06-231-45/+2
| | | | | | | | | | | | believed that all 486-class CPUs FreeBSD is capable to run on, either have no FPU and cannot use external coprocessor, or have FPU on the package and can use #MF. Reviewed by: bde Tested by: pho (previous version) Notes: svn path=/head/; revision=209461
* Implement new event timers infrastructure. It provides unified APIs forAlexander Motin2010-06-201-39/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writing event timer drivers, for choosing best possible drivers by machine independent code and for operating them to supply kernel with hardclock(), statclock() and profclock() events in unified fashion on various hardware. Infrastructure provides support for both per-CPU (independent for every CPU core) and global timers in periodic and one-shot modes. MI management code at this moment uses only periodic mode, but one-shot mode use planned for later, as part of tickless kernel project. For this moment infrastructure used on i386 and amd64 architectures. Other archs are welcome to follow, while their current operation should not be affected. This patch updates existing drivers (i8254, RTC and LAPIC) for the new order, and adds event timers support into the HPET driver. These drivers have different capabilities: LAPIC - per-CPU timer, supports periodic and one-shot operation, may freeze in C3 state, calibrated on first use, so may be not exactly precise. HPET - depending on hardware can work as per-CPU or global, supports periodic and one-shot operation, usually provides several event timers. i8254 - global, limited to periodic mode, because same hardware used also as time counter. RTC - global, supports only periodic mode, set of frequencies in Hz limited by powers of 2. Depending on hardware capabilities, drivers preferred in following orders, either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. User may explicitly specify wanted timers via loader tunables or sysctls: kern.eventtimer.timer1 and kern.eventtimer.timer2. If requested driver is unavailable or unoperational, system will try to replace it. If no more timers available or "NONE" specified for second, system will operate using only one timer, multiplying it's frequency by few times and uing respective dividers to honor hz, stathz and profhz values, set during initial setup. Notes: svn path=/head/; revision=209371
* Introduce the x86 kernel interfaces to allow kernel code to useKonstantin Belousov2010-06-051-4/+4
| | | | | | | | | | | | | | | | | | | FPU/SSE hardware. Caller should provide a save area that is chained into the stack of the areas; pcb save_area for usermode FPU state is on top. The pcb now contains a pointer to the current FPU saved area, used during FPUDNA handling and context switches. There is also a facility to allow the kernel thread to use pcb save_area. Change the dreaded warnings "npxdna in kernel mode!" into the panics when FPU usage is not registered. KPI discussed with: fabient Tested by: pho, fabient Hardware provided by: Sentex Communications MFC after: 1 month Notes: svn path=/head/; revision=208833
* MFi386: the part of revision 181809Yoshihiro Takahashi2010-05-291-5/+5
| | | | | | | Use SEL_KPL macro. Notes: svn path=/head/; revision=208639
* MFi386: revision 178471Yoshihiro Takahashi2010-05-291-42/+150
| | | | | | | | | | | | | | | | | - Add an integer argument to idle to indicate how likely we are to wake from idle over the next tick. - Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are suspended in cpu specific states. This function can fail and cause the scheduler to fall back to another mechanism (ipi). - Implement support for mwait in cpu_idle() on i386/amd64 machines that support it. mwait is a higher performance way to synchronize cpus as compared to hlt & ipis. - Allow selecting the idle routine by name via sysctl machdep.idle. This replaces machdep.cpu_idle_hlt. Only idle routines supported by the current machine are permitted. Notes: svn path=/head/; revision=208638
* Reduce diffs against i386.Yoshihiro Takahashi2010-05-291-11/+17
| | | | Notes: svn path=/head/; revision=208634
* MFi386: revision 208621Yoshihiro Takahashi2010-05-291-2/+0
| | | | | | | | Defer initializing machine checks for the boot CPU until the local APIC is fully configured. Notes: svn path=/head/; revision=208633
* MFi386: revision 208604Yoshihiro Takahashi2010-05-291-0/+14
| | | | | | | Clarify a potential issue in get_fpcontext() use. Notes: svn path=/head/; revision=208632
* Reduce diffs against syscons_isa.c. No functional changes.Yoshihiro Takahashi2010-05-261-29/+34
| | | | Notes: svn path=/head/; revision=208563
* - Implement MI helper functions, dividing one or two timer interrupts withAlexander Motin2010-05-241-11/+10
| | | | | | | | | | | arbitrary frequencies into hardclock(), statclock() and profclock() calls. Same code with minor variations duplicated several times over the tree for different timer drivers and architectures. - Switch all x86 archs to new functions, simplifying the code and removing extra logic from timer drivers. Other archs are also welcome. Notes: svn path=/head/; revision=208494
* Change ad_firmware_geom_adjust() to operate on a struct disk * only andMarius Strobl2010-05-202-18/+16
| | | | | | | | | | | | hook it up to ada(4) also. While at it, rename *ad_firmware_geom_adjust() to *ata_disk_firmware_geom_adjust() etc now that these are no longer limited to ad(4). Reviewed by: mav MFC after: 3 days Notes: svn path=/head/; revision=208349
* MFi386: revision 206553Yoshihiro Takahashi2010-04-291-4/+8
| | | | | | | | - Change printf() calls to uprintf() for sigreturn(). - Normalize the messages to include both pid and thread name. Notes: svn path=/head/; revision=207355
* Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this hadAndrew Thompson2010-04-221-0/+1
| | | | | | | | | the illusion of a tunable setting but was always turned on regardless. MFC after: 1 week Notes: svn path=/head/; revision=207077
* Comply with the new cyclic dtrace module variable nameRui Paulo2010-04-211-2/+2
| | | | | | | (cyclic_clock_func). Notes: svn path=/head/; revision=206993
* Default the machdep.lapic_allclocks to be enabled in order to cope withAttilio Rao2010-04-091-1/+1
| | | | | | | | | | | | | broken atrtc. Now if you want more correct stats on profhz and stathz it may be disabled by setting to 0. Reported by: A. Akephalos <akephalos dot akephalos at gmail dot com>, Jakub Lach <jakub_lach at mailplus dot pl> MFC: 1 week Notes: svn path=/head/; revision=206421
* Change the arguments of exec_setregs() so that it receives a pointerNathan Whitehorn2010-03-251-7/+3
| | | | | | | | | | | to the image_params struct instead of several members of that struct individually. This makes it easier to expand its arguments in the future without touching all platforms. Reviewed by: jhb Notes: svn path=/head/; revision=205642
* Remove COMPAT_43TTY from stock kernel configuration files.Ed Schouten2010-03-131-1/+0
| | | | | | | | | | | COMPAT_43TTY enables the sgtty interface. Even though its exposure has only been removed in FreeBSD 8.0, it wasn't used by anything in the base system in FreeBSD 5.x (possibly even 4.x?). On those releases, if your ports/packages are less than two years old, they will prefer termios over sgtty. Notes: svn path=/head/; revision=205116
* MFx86: the part of r204641Yoshihiro Takahashi2010-03-051-2/+7
| | | | | | | | | | | | In order to do that cleanly, lapic_setup_clock(), on both ia32 and amd64, now accepts as arguments the desired sources to handle, and returns the actual ones (LAPIC_CLOCK_NONE is forbidden because otherwise there is no meaning in calling such function). This allows to bring out into commont x86 code the handling part for machdep.lapic_allclocks tunable, which is retained. Notes: svn path=/head/; revision=204753
* Introduce the new kernel sub-tree x86 which should contain all the codeAttilio Rao2010-02-251-1/+1
| | | | | | | | | | | | | | | | | shared and generalized between our current amd64, i386 and pc98. This is just an initial step that should lead to a more complete effort. For the moment, a very simple porting of cpufreq modules, BIOS calls and the whole MD specific ISA bus part is added to the sub-tree but ideally a lot of code might be added and more shared support should grow. Sponsored by: Sandvine Incorporated Reviewed by: emaste, kib, jhb, imp Discussed on: arch MFC: 3 weeks Notes: svn path=/head/; revision=204309
* Adjust style (following the already existing rules) for the newlyAttilio Rao2010-02-151-1/+1
| | | | | | | | | introduced option DEADLKRES. Reported by: danfe, julian, avg Notes: svn path=/head/; revision=203938
* Add the options DEADLKRES (introducing the deadlock resolver thread) inAttilio Rao2010-02-101-0/+1
| | | | | | | | | | | | | the 'debugging' section of any HEAD kernel and enable for the mainstream ones, excluding the embedded architectures. It may, of course, enabled on a case-by-case basis. Sponsored by: Sandvine Incorporated Requested by: emaste Discussed with: kib Notes: svn path=/head/; revision=203758
* Move the examples for the 'hints' and 'env' keywords from various GENERICJohn Baldwin2010-01-191-9/+0
| | | | | | | | | kernel configs into NOTES. Reviewed by: imp Notes: svn path=/head/; revision=202634
* - Allow clock subsystem to be compiled without the apic support [0]Attilio Rao2010-01-172-2/+3
| | | | | | | | | | | - ATPIC, on pc98 is never defined somewhere, differently from i386. Turn its compilation to be conditional as i386 does. [1] [0] Reported by: nyan [1] Submitted by: nyan Notes: svn path=/head/; revision=202534
* Handling all the three clocks (hardclock, softclock, profclock) with theAttilio Rao2010-01-151-4/+5
| | | | | | | | | | | | | | | | | | | | | LAPIC may lead to aliasing for softclock and profclock because frequencies are sized in order to fit mainly hardclock. atrtc used to take care of the softclock and profclock and it does still do, if the LAPIC can't handle the clocks properly. Revert the change when the LAPIC started taking charge of all three of them and let atrtc handle softclock and profclock if not explicitly requested. Such request can be made setting != 0 the new tunable machdep.lapic_allclocks or if the new device ATPIC is not present within the i386 kernel config (atrtc is linked to atpic presence). Diagnosed by: Sandvine Incorporated Reviewed by: jhb, emaste Sponsored by: Sandvine Incorporated MFC: 3 weeks Notes: svn path=/head/; revision=202387
* Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.Warner Losh2010-01-101-0/+1
| | | | | | | | | # This is the resolution of removing it from DEFAULTS... MFC after: 5 days Notes: svn path=/head/; revision=202019
* In sys/<arch>/conf/Makefile set TARGET to <arch>. That allowsBjoern A. Zeeb2010-01-081-0/+2
| | | | | | | | | | | | | | | | | | | sys/conf/makeLINT.mk to only do certain things for certain architectures. Note that neither arm nor mips have the Makefile there, thus essentially not (yet) supporting LINT. This would enable them do add special treatment to sys/conf/makeLINT.mk as well chosing one of the many configurations as LINT. This is a hack of doing this and keeping it in a separate commit will allow us to more easily identify and back it out. Discussed on/with: arch, jhb (as part of the LINT-VIMAGE thread) MFC after: 1 month Notes: svn path=/head/; revision=201813