DragonFly BSD

CVS log for src/sys/i386/isa/Attic/clock.c

[BACK] Up to [DragonFly] / src / sys / i386 / isa

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.47
Sun Oct 22 16:09:22 2006 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
CVS tags: HEAD
FILE REMOVED
Changes since revision 1.46: +1 -1 lines
Reorganize the way machine architectures are handled.  Consolidate the
kernel configurations into a single generic directory.  Move machine-specific
Makefile's and loader scripts into the appropriate architecture directory.

Kernel and module builds also generally add sys/arch to the include path so
source files that include architecture-specific headers do not have to
be adjusted.

sys/<ARCH>		-> sys/arch/<ARCH>
sys/conf/*.<ARCH>	-> sys/arch/<ARCH>/conf/*.<ARCH>
sys/<ARCH>/conf/<KERNEL> -> sys/config/<KERNEL>

Revision 1.44.2.1: download - view: text, markup, annotated - select for diffs
Tue Feb 28 21:47:58 2006 UTC (8 years, 6 months ago) by dillon
Branches: DragonFly_RELEASE_1_4
CVS tags: DragonFly_RELEASE_1_4_Slip
Diff to: previous 1.44: preferred, unified; next MAIN 1.45: preferred, unified
Changes since revision 1.44: +9 -5 lines
MFC the new random number generator entropy code from the commit on
"2006/01/25 11:56:31 PST".

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed Jan 25 19:56:19 2006 UTC (8 years, 7 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.45: preferred, unified
Changes since revision 1.45: +9 -5 lines
The random number generator was not generating sufficient entropy by
default, resulting in weak random numbers for a short period of time after
a machine is first booted.

* Change the entropy default for all interrupts except the clock interrupt
  from off to on.

* Greatly reduce the overhead of the interrupt entropy code so even high
  performance interrupts can call it.

* Instead of calculating the entropy at the time of the interrupt,
  introduce a new rate-limited kernel thread which the interrupt code can
  simply schedule.  The new thread will be responsible for adding the
  entropy.

  This thread will rate-limit based on the amount of entropy that has been
  built up.  The more entropy we have, the lower the thread's frequency of
  operation.  Currently the limit is set to 25 hz.

* Use the TSC in addition to the normal time calculation when introducing
  entropy.

Note that during tests it was found that a new ssh connection tends to
'eat' all available entropy.  This isn't actually true, it's really the
entropy calculation itself which is not quite correct, but I am duely noting
the issue here.

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>

Revision 1.45: download - view: text, markup, annotated - select for diffs
Sat Dec 24 20:34:04 2005 UTC (8 years, 8 months ago) by swildner
Branches: MAIN
Diff to: previous 1.44: preferred, unified
Changes since revision 1.44: +6 -7 lines
* Ansify function definitions.

* Remove (void) casts for discarded return values.

* Remove parameter names from function prototypes.

In-collaboration-with: Alexey Slynko <slynko@tronet.ru>

Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue Dec 6 23:37:51 2005 UTC (8 years, 9 months ago) by dillon
Branches: MAIN
Branch point for: DragonFly_RELEASE_1_4
Diff to: previous 1.43: preferred, unified
Changes since revision 1.43: +11 -5 lines
Synchronize the TSC between all cpus on startup and provide a sysctl,
debug.ktr.resynchronize, which will (very expensively) resynchronize the
TSCs 10 times a second to reduce drift errors to manageable numbers.

The TSC on all the cpus for the purposes of ktrdump's ought to be
synchronizated within ~200ns of each other, assuming all cpus are running
at the same frequency.

This needs more work.  What we really need to do is calculate the drift
for each cpu and apply it dynamically.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Mon Nov 21 18:02:42 2005 UTC (8 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.42: preferred, unified
Changes since revision 1.42: +14 -13 lines
Remove inthand_add() and inthand_remove().  Instead, register_int() and
unregister_int() are called directly and the machine level vector setup and
teardown ABI calls are made from register_int() and unregister_int().

Revision 1.42: download - view: text, markup, annotated - select for diffs
Fri Nov 4 19:42:36 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.41: preferred, unified
Changes since revision 1.41: +14 -10 lines
Mark our fine-grained interrupt timer as being INTR_MPSAFE, because it is.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Fri Nov 4 08:57:31 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.40: preferred, unified
Changes since revision 1.40: +1 -6 lines
Allow 'options SMP' *WITHOUT* 'options APIC_IO'.  That is, an ability to
produce an SMP-capable kernel that uses the PIC/ICU instead of the IO APICs
for interrupt routing.

SMP boxes with broken BIOSes (namely my Shuttle XPC SN95G5) could very well
have serious interrupt routing problems when operating in IO APIC mode.
One solution is to not use the IO APICs.  That is, to run only the Local
APICs for the SMP management.

* Don't conditionalize NIDT.  Just set it to 256

* Make the ICU interrupt code MP SAFE.  This primarily means using the
  imen_spinlock to protect accesses to icu_imen.

* When running SMP without APIC_IO, set the LAPIC TPR to prevent unintentional
  interrupts.  Leave LINT0 enabled (normally with APIC_IO LINT0 is disabled
  when the IO APICs are activated).  LINT0 is the virtual wire between the
  8259 and LAPIC 0.

* Get rid of NRSVIDT.  Just use IDT_OFFSET instead.

* Clean up all the APIC_IO tests which should have been SMP tests, and all
  the SMP tests which should have been APIC_IO tests.  Explicitly #ifdef
  out all code related to the IO APICs when APIC_IO is not set.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Nov 2 22:59:47 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +0 -1 lines
ICU/APIC cleanup part 7/many.

Get rid of most of the dependancies on ICU_LEN, NSWI, and NHWI, by
creating a generous system standard maximum for hardware and software
interrupts in the MI sys/interrupt.h.  The interrupt architecture can
then further limit available hardware and software interrupts.  For
example, i386 uses 32 bit masks and so is limited to 32 hardware interrupts
and 32 software interrupts.

The name ICU_OFFSET is confusing, rename it to IDT_OFFSET, which is what
it really is.

Note that this separation is possible due to recent work on the MI interrupt
layer.

Separate the software interrupt mask from the hardware interrupt mask
in the i386 code.

Get rid of rndcontrol's 16 irq limit by creating a new ioctl to iterate
through interrupt numbers.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Nov 2 18:42:08 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +6 -10 lines
ICU/APIC cleanup part 5/many.

Start migrating the ICU and APIC interrupt interfaces to a new machine
level interrupt ABI.  This ABI will eventually be tied into the BUS
architecture.

Move INTRDIS/INTREN to the new API: machintr_intrdis(irq) and
machintr_intren(irq).

Get rid of ithread_unmask().  Have the interrupt thread code call
machintr_intrdis(irq) directly.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Nov 2 17:47:33 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +5 -5 lines
ICU/APIC cleanup part 4/many.

INTRDIS/INTREN only always take a single bit.  Change the argument
from a mask to a bit number to improve flexibility.  Relabel the
ICU IRQ's (IRQ0, IRQ1, ...) to ICU_IRQ* while we are at it.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Wed Nov 2 08:33:28 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +1 -1 lines
ICU/APIC cleanup part 1/many.

Move ICU and APIC support files into their own subdirectory, bump the
required config version for the build since this move also requires the
use of the new arch/ symlink.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Tue Oct 25 17:26:21 2005 UTC (8 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +10 -2 lines
Remove the dummy IPI messaging routines for UP builds and properly
conditionalize the use of IPI messages in various core kernel modules.

Change the callback from func(arg, frameptr) to func(arg1, arg2, frameptr),
where the new argument (arg2) is an integer supplied by the originator.

Create wrappers for simpler versions of the callback: func(arg1), and
func(arg1, arg2) (for the moment we presume that GCC will generate code
for the full-sized three-argument callback which is compatible with one
and two-argument function pointers).

This extension to the IPI messaging code is needed to properly implement
MP-safe tsleep/wakeup code.  Although the extra argument is superfluous in
most cases, the overhead of doing an IPI is such that there should be no
noticeable impact on performance.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sat Oct 15 21:03:24 2005 UTC (8 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +16 -1 lines
Only resynchronize the RTC on shutdown if we had previously loaded it and
we are not in a panic.  This prevents early failures and panics from
writing a bad time back into the RTC.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sat Oct 15 03:22:59 2005 UTC (8 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +4 -4 lines
Implement an emergency interrupt polling feature.  When enabled, most
interrupt handlers installed on the system will be polled at the specified
frequency.  The exceptions are the 8254 clock and ATA interrupts (ATA can
blow up if it gets a fake interrupt, and the 8254 needs to work for systimers
to work which the poller is based on).  These variables may be specified
in /boot/loader.conf and/or adjusted on a live system with sysctl.

kern.emergency_intr_enable	(default 0 = off)
kern.emergency_intr_freq	(default 10 = 10 hz)

THIS FEATURE IS NOT DESIGNED TO BE USED ON PRODUCTION SYSTEMS.  It should be
used only for kernel development, debugging, and testing, to get devices to
work that would otherwise not work due to messed up interrupt routing, or if
you have no other choice.  This feature has VERY HIGH OVERHEAD, as a dozen or
more service routines may be called on each tick.  The feature can be
life-safer e.g. on machines that would otherwise not work at all with
DragonFly, to get them working well enough that they can communicate with
the outside world.  As mentioned already, the primary use of this feature
is to aid in kernel development.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Thu Oct 13 00:02:47 2005 UTC (8 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +12 -20 lines
Major cleanup of the interrupt registration subsystem.

* Collapse the separate registrations in the kernel interrupt thread and
  i386 layers into a single machine-independant kernel interrupt thread layer
  in kern/kern_intr.c.  Get rid of the i386 layer's 'MUX' code entirely.

* Have the interrupt vector assembly code (icu_vector.s and apic_vector.s)
  call a machine-independant function in the kernel interrupt thread
  layer to figure out how to process an interrupt.

* Move a lot of assembly into the new C interrupt processing function.

* Add support for INTR_MPSAFE.  If a device driver registers an interrupt
  as being MPSAFE, the Big Giant Lock will not be obtained or required.

* Temporarily just schedule the ithread if a FAST interrupt cannot be executed
  due to its serializer being locked.

* Add LWKT serialization support for a non-blocking 'try' function.

* Get rid of ointhand2_t and adjust all old ISA code to use inthand2_t.

* Supply a frame pointer as a pointer rather then embedding it on th stack.

* Allow FAST and SLOW interrupts to be mixed on the same IRQ, though this
  will not necessarily result in optimal operation.

* Remove direct APIC/ICU vector calls from the apic/icu vector assembly code.
  Everything goes through the new routine in kern/kern_intr.c now.

* Add a new flag, INTR_NOPOLL.  Interrupts registered with the flag will
  not be polled by the upcoming emergency general interrupt polling
  sysctl (e.g. ATA cannot be safely polled due to the way ATA register
  access interferes with ATA DMA).

* Remove most of the distinction in the i386 assembly layers between FAST
  and SLOW interrupts (part 1/2).

* Revamp the interrupt name array returned to userland to list multiple
  drivers associated with the same IRQ.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Mon Sep 12 21:32:03 2005 UTC (9 years ago) by joerg
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +3 -0 lines
Call resettodr on shutdown to ensure that RTC and wall clock gets
synchronised. This should make clock drifts on long running systems not
depend on the initial sync.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Jun 16 21:12:47 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +4 -7 lines
Remove all remaining SPL code.  Replace the mtd_cpl field in the machine
dependant thread structure and the CPL field in the interrupt stack frame
with dummies (so structural sizes do not change, yet).  Remove all interrupt
handler SPL mask and mask pointer code.  Remove all spl*() functions except
for splz().

Note that doreti uses a temporary CPL mask internally to accumulate a bitmap
of FAST interrupts which could not be executed due to not being able to get
the BGL.  This mask has no outside visibility.

Note that gd_fpending and gd_ipending still exist to support critical section
interrupt deferment.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sat Jun 11 09:03:49 2005 UTC (9 years, 3 months ago) by swildner
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +0 -10 lines
Dispose of support for IBM's Micro Channel architecture (MCA).

Revision 1.29: download - view: text, markup, annotated - select for diffs
Thu Jun 9 19:14:12 2005 UTC (9 years, 3 months ago) by eirikn
Branches: MAIN
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +1 -1 lines
Replace the hand rolled linked list with a SLIST.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Fri Jun 3 17:14:51 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +4 -7 lines
Remove spl*() calls from i386, replacing them with critical sections.
Leave spl support intact for the moment (it will be removed soon).  Adjust
the interrupt mux to use a critical section for 'old' interrupt handlers
not using the new serialization API (which is nearly all of them at the
moment).

Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Jun 1 22:55:19 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +3 -1 lines
Fix a recursive clock_lock() on SMP systems which was deadlocking on boot.
(related to the new system timer API).

Revision 1.26: download - view: text, markup, annotated - select for diffs
Wed Jun 1 22:25:11 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +39 -34 lines
Add a simple API tha allows the interrupt timer to efficiently convert
system hardware ticks (e.g. ACPI at 3x the frequency) to interrupt timer
ticks (e.g. 8254 timer 0).

Remove the sysctl code that allows the system hardware timer to be selected
after boot.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Jun 1 20:19:45 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +13 -6 lines
More cleanups, add the API implementation to select the system clock.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Wed Jun 1 17:43:46 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +106 -61 lines
Implement a new cputimer infrastructure to allow us to support different
time bases.  This is in preparation for adding support for the ACPI timer
as the system's free-running counter instead of the i8254 timer 1 or timer 2.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Tue May 24 20:59:05 2005 UTC (9 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +5 -4 lines
Get rid of bus_{disable,enable}_intr(), it wasn't generic enough for
our needs.

Implement some generic atomic.h functions to aid in the implementation of
a low level mutex.

Implement a generic low level sleep-mutex serializer, kern/lwkt_serialize.c.
The serializer is designed to be a replacement for SPL calls but may also
be used for other very low level work (e.g. lockmgr interlocks).

Add a serializer argument to BUS_SETUP_INTR().  When non-NULL, the interrupt
handler will no longer be protected by an SPL so e.g. spl*() will no
longer protect against that device's interrupts.

The IF queueing and dequeueing mechanisms may no longer depend on outside
SPL state because network driver interrupt handlers are no longer required to
enter splnet().  Use critical sections for the moment.  The IFQ and
IFF_OACTIVE interactions are not yet MP safe.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Mon Apr 4 17:49:09 2005 UTC (9 years, 5 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +26 -24 lines
Replace TIMER_USE_1 kernel option with hw.i8254.walltimer tunable.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun Mar 27 19:25:07 2005 UTC (9 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +4 -2 lines
Fix a bug where the main system clock stops operating.  We were using a field
in the globaldata structure called gd_nextclock to determine whether a systimer
was queued for a cpu.  This field indicated the next pending timeout for the
systimer on the cpu.  However, at 8254 rates this 32 bit field has a chance of
calculating to 0 once every 1/18 second, which disables the systimer dispatch
on that cpu and can cause the system clocks to stop operating.

Remove the field and replace with a TAILQ_FIRST queue check instead.

The machine dependant part of the systimer implementations needs a better
way to figure out which cpus to dispatch to.

Reported-by: justin@shiningsilence.com

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat Nov 20 20:25:08 2004 UTC (9 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +6 -5 lines
Add code to the BIOS VM86 emulator to detect writes to the 8254.  If a
write is detected the 8254 is reset after the bios call returns and the
event is reported.  Some bioses, in particular video bioses, uses timer 2
for timing things.  We need timer 2 for our master clock.

Remove restoreclocks().  This was causing gd_cpuclock_base to reverse index
and jump the time ahead an hour with a flurry of hardclock interrupts.

Introduce a new systimer API call, systimer_init_periodic_nq(), which
installs a non-queued periodic systimer.  Non-queued means that if multiple
events built-up (due to an 8254 glitch, sleep, or other event), only one
event will be reported.

This should fix the BIOS/8254 glitching, the 'hour jump' problem, and
hopefully other timer jumping issues as well.

Bugs-reported-by: Andreas Hauser <andy@splashground.de>,
		Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>,
		and others

Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Sep 27 04:04:09 2004 UTC (9 years, 11 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +8 -4 lines
Minor cleanups to TIMER_USE_1 (no real fixes or anything).

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:02:51 2004 UTC (9 years, 11 months ago) by joerg
Branches: MAIN
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +7 -1 lines
Add a new option "TIMER_USE_1", which allows switching the primary heart
beat from i8254 timer 2 to timer 1. This also reactivates the console beep
if TIMER_USE_1 is active.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Sep 17 00:18:13 2004 UTC (10 years ago) by joerg
Branches: MAIN
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +4 -2 lines
timeout/untimeout ==> callout_*

Revision 1.16: download - view: text, markup, annotated - select for diffs
Mon Aug 2 23:20:30 2004 UTC (10 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap13Sep2004
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +8 -4 lines
Make doubly sure that timer2 is not used for speaker operation.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue Jul 20 04:12:08 2004 UTC (10 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +31 -8 lines
Unconditionally print startup 8254 and TSC calibrations.

Add the hw.i8254 sysctl node which returns systimer statistics.  In
particular, hw.i8254.timestamp generates both an 8254 and a TSC timestamp
and can be used to check whether the 8254 timer 2 has gone whacko or not.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Apr 4 08:00:06 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +6 -3 lines
Setting the date/time does not always properly write-back the RTC, causing
the date/time to be wrong again after a reboot.  This was due to the recent
systimer changes which updated the 'time_second' global via hardclock() only.
Change the writeback code to use microtime() instead of time_second.

Reported-by: esmith <esmith@patmedia.net>

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Feb 21 06:37:08 2004 UTC (10 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +1 -0 lines
Synchronize a bunch of things from FreeBSD-5 in preparation for the new
ACPICA driver support.

* Bring in a lot of new bus and pci DEV_METHODs from FreeBSD-5
* split apic.h into apicreg.h and apicio.h
* rename INTR_TYPE_FAST -> INTR_FAST and move the #define
* rename INTR_TYPE_EXCL -> INTR_EXCL and move the #define
* rename some PCIR_ registers and add additional macros from FreeBSD-5
* note: new pcib bus call, host_pcib_get_busno() imported.
* kern/subr_power.c no longer optional.

Other changes:

* machine/smp.h machine smp/smptests.h can now be #included unconditionally,
  and some APIC_IO vs SMP separation has been done as well.
* gd_acpi_id and gd_apic_id added to machine/globaldata.h prep for new
  ACPI code.

Despite all the changes, the generated code should be virtually the same.
These were mostly additions which the pre-existing code does not (yet) use.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Feb 12 06:57:46 2004 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +1 -1 lines
Change lwkt_send_ipiq() and lwkt_wait_ipiq() to take a globaldata_t instead
of a cpuid.  This is part of an ongoing cleanup to use globaldata_t's to
reference other cpus rather then their cpu numbers, reducing the number of
serialized memory indirections required in a number of code paths and
making more context available to the target code.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Jan 30 05:42:16 2004 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +223 -445 lines
This commit represents a major revamping of the clock interrupt and timebase
infrastructure in DragonFly.

* Rip out the existing 8254 timer 0 code, and also disable the use of
  Timer 2 (which means that the PC speaker will no longer go beep).  Timer 0
  used to represent a periodic interrupt and a great deal of code was in
  place to attempt to obtain a timebase off of that periodic interrupt.

  Timer 0 is now used in software retriggerable one-shot mode to produce
  variable-delay interrupts.  A new hardware interrupt clock abstraction
  called SYSTIMERS has been introduced which allows threads to register
  periodic or one-shot interrupt/IPI callbacks at approximately 1uS
  granularity.

  Timer 2 is now set in continuous periodic mode with a period of 65536
  and provides the timebase for the system, abstracted to 32 bits.

  All the old platform-integrated hardclock() and statclock() code has
  been rewritten.  The old IPI forwarding code has been #if 0'd out and
  will soon be entirely removed (the systimer abstraction takes care of
  multi-cpu registrations now).  The architecture-specific clkintr() now
  simply calls an entry point into the systimer and provides a Timer 0
  reload and Timer 2 timebase function API.

* On both UP and SMP systems, cpus register systimer interrupts for the Hz
  interrupt, the stat interrupt, and the scheduler round-robin interrupt.
  The abstraction is carefully designed to allow multiple interrupts occuring
  at the same time to be processed in a single hardware interrupt.  While
  we currently use IPI's to distribute requested interrupts from other cpu's,
  the intent is to use the abstraction to take advantage of per-cpu timers
  when available (e.g. on the LAPIC) in the future.

  systimer interrupts run OUTSIDE THE MP LOCK.  Entry points may be called
  from the hard interrupt or via an IPI message (IPI messages have always
  run outside the MP lock).

* Rip out timecounters and disable alternative timecounter code for other
  time sources.  This is temporary.  Eventually other time sources, such as
  the TSC, will be reintegrated as independant, parallel-running entities.
  There will be no 'time switching' per-say, subsystems will be able to
  select which timebase they wish to use.  It is desireable to reintegrate
  at least the TSC to improve [get]{micro,nano}[up]time() performance.

  WARNING: PPS events may not work properly.  They were not removed, but
  they have not been retested with the new code either.

* Remove spl protection around [get]{micro,nano}[up]time() calls, they are
  now internally protected.

* Use uptime instead of realtime in certain CAM timeout tests

* Remove struct clockframe.  Use struct intrframe everywhere where clockframe
  used to be used.

* Replace most splstatclock() protections with crit_*() protections, because
  such protections must now also protect against IPI messaging interrupts.

* Add fields to the per-cpu globaldata structure to access timebase related
  information using only a critical section rather then a mutex.  However,
  the 8254 Timer 2 access code still uses spin locks.  More work needs to
  be done here, the 'realtime' correction is still done in a single global
  'struct timespec basetime' structure.

* Remove the CLKINTR_PENDING icu and apic interrupt hacks.

* Augment the IPI Messaging code to make an intrframe available to callbacks.

* Document 8254 timing modes in i386/sai/timerreg.h.  Note that at the
  moment we assume an 8254 instead of an 8253 as we are using TIMER_SWSTROBE
  mode.  This may or may not have to be changed to an 8253 mode.

* Integrate the NTP correction code into the new timebase subsystem.

* Separate boottime from basettime.  Once boottime is believed to be stable
  it is no longer effected by NTP or other time corrections.

CAVETS:

	* PC speaker no longer works

	* Profiling interrupt rate not increased (it needs work to be
	  made operational on a per-cpu basis rather then system-wide).

	* The native timebase API is function-based, but currently hardwired.

	* There might or might not be issues with 486 systems due to the
	  timer mode I am using.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Jan 8 08:11:12 2004 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +31 -14 lines
Make the phase synchronization of the hz clock interrupt (I8254 timer0)
to the timecounter more generic.  This will work with all time counters
as long as the 8254's crystal isn't to terribly off, but it could take a
few minutes for the computer to lock the phase after boot.  I'm being
conservative here and do not want to skew the clock interrupt too much.

Tested by: Paul Herman <pherman@frenchfries.net>

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Jan 7 20:21:20 2004 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +6 -2 lines
Fix a bug introduced in the last commit.  When calculating the delta count
from the 8254 we have to use timer0_max_count + 1 instead of timer0_max_count
because our frequency correction may load timer0_max_count + 1.

Implement clkintr_pending in the FAST_INTR path as well as the normal INTR
path.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Wed Jan 7 10:59:09 2004 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +38 -11 lines
Compensate for the frequency error that occurs at higher 'hz' settings.
e.g. by default at 100hz the 8254 running at 1193182Hz needs
a count load of 11931.82, but we can only load integer values so the
clock interrupt winds up being slightly slower or faster then 100hz.
This will fix phase creep in things like nanosleep().

The problem is solved by keeping track of the fractional error and
adjusting the counter load register for the following interrupt.

Report-by:  Paul Herman <pherman@frenchfries.net>

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sat Nov 15 21:05:43 2003 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +1 -1 lines
Misc cleanups to take care of GCC3.x warnings.  Missing 'U' and 'LL'
postfixes on large unsigned or 64 bit constants, non-storage structural
declarations embedded in structures, deprecated use of __FUNCTION__,
missing 'break' statements in the last switch case, goto label ops where
the label occurs just before an end-brace (many of which appear to be
fixable with 'break' or 'continue' instead and existed simply due to
programmer-paranoia), garbage data in #endif lines that was not commented
out.  GCC3 also caught some argument count issues in kernel printfs.

Many of these (obvious) fixes are similar to or copied from 5.x.

Also fix a few other minor issues such as certain drivers declaring a
proc pointer instead of a thread pointer.

Move -ffreestanding from CWARNFLAGS to CFLAGS.  It doesn't belong in
CWARNFLAGS.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Aug 26 21:42:19 2003 UTC (11 years ago) by rob
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +7 -7 lines
what the heck one last one before i go take a nap...

remove __P(); from the i386 directory

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Aug 7 21:17:23 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +6 -6 lines
kernel tree reorganization stage 1: Major cvs repository work (not logged as
commits) plus a major reworking of the #include's to accomodate the
relocations.

    * CVS repository files manually moved.  Old directories left intact
      and empty (temporary).

    * Reorganize all filesystems into vfs/, most devices into dev/,
      sub-divide devices by function.

    * Begin to move device-specific architecture files to the device
      subdirs rather then throwing them all into, e.g. i386/include

    * Reorganize files related to system busses, placing the related code
      in a new bus/ directory.  Also move cam to bus/cam though this may
      not have been the best idea in retrospect.

    * Reorganize emulation code and place it in a new emulation/ directory.

    * Remove the -I- compiler option in order to allow #include file
      localization, rename all config generated X.h files to use_X.h to
      clean up the conflicts.

    * Remove /usr/src/include (or /usr/include) dependancies during the
      kernel build, beyond what is normally needed to compile helper
      programs.

    * Make config create 'machine' softlinks for architecture specific
      directories outside of the standard <arch>/include.

    * Bump the config rev.

    WARNING! after this commit /usr/include and /usr/src/sys/compile/*
    should be regenerated from scratch.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sun Jul 6 21:23:49 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +17 -33 lines
MP Implementation 1/2: Get the APIC code working again, sweetly integrate the
MP lock into the LWKT scheduler, replace the old simplelock code with
tokens or spin locks as appropriate.  In particular, the vnode interlock
(and most other interlocks) are now tokens.  Also clean up a few curproc/cred
sequences that are no longer needed.

The APs are left in degenerate state with non IPI interrupts disabled as
additional LWKT work must be done before we can really make use of them,
and FAST interrupts are not managed by the MP lock yet.  The main thing
for this stage was to get the system working with an APIC again.

buildworld tested on UP and 2xCPU/MP (Dell 2550)

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Jun 29 07:37:06 2003 UTC (11 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +5 -5 lines
Misc interrupts/LWKT 1/2: interlock the idle thread.  Put execution of
fast interrupts inside a critical section.  Make the hardclock and statclock
INTR_FAST.  Implement the strict priority queue mechanism for LWKTs.
Implement prioritized preemption for interrupt and softint preemption.
Keep better stats.

Note: this commit hacks up the userland scheduler, in particular the
notion of 'curproc' because threaded interrupts really mess up the userland
scheduler's idea of curproc, which it uses to assume that the process is not
on a run queue even though it is runnable.  The next step will be to
separate out and cleanup the userland scheduler.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:36 2003 UTC (11 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +1 -0 lines
Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids.  Most
ids have been removed from !lint sections and moved into comment sections.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jun 17 02:54:47 2003 UTC (11 years, 3 months ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.149.2.6

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options