dragonfly.git
3 years agokernel -- vm_object locking: DEBUG_LOCKS check for hold_wait vs hold deadlock
Venkatesh Srinivas [Sun, 27 Mar 2011 14:20:20 +0000 (07:20 -0700)]
kernel -- vm_object locking: DEBUG_LOCKS check for hold_wait vs hold deadlock

If a thread has a hold on a vm_object and enters hold_wait (via either
vm_object_terminate or vm_object_collapse), it will wait forever for the hold
count to hit 0. Record the threads holding an object in a per-object array.

3 years agoacpi: Style and white space changes
Sepherosa Ziehau [Tue, 22 Mar 2011 07:26:41 +0000 (15:26 +0800)]
acpi: Style and white space changes

3 years agoacpi/pcib: Fix interrupt routing code
Sepherosa Ziehau [Tue, 22 Mar 2011 07:04:16 +0000 (15:04 +0800)]
acpi/pcib: Fix interrupt routing code

3 years agoacpi/pcib: Use pcib_alloc_resource as bus alloc_resource method
Sepherosa Ziehau [Tue, 22 Mar 2011 07:03:06 +0000 (15:03 +0800)]
acpi/pcib: Use pcib_alloc_resource as bus alloc_resource method

3 years agoacpi: Remove no longer needed file
Sepherosa Ziehau [Tue, 22 Mar 2011 03:16:33 +0000 (11:16 +0800)]
acpi: Remove no longer needed file

3 years agoacpi: Minor style changes
Sepherosa Ziehau [Tue, 22 Mar 2011 02:48:48 +0000 (10:48 +0800)]
acpi: Minor style changes

3 years agoAcpi userland: adapt to 20110211 upgrade and sync with FreeBSD 8.0
Magliano Andrea [Thu, 3 Mar 2011 05:00:33 +0000 (06:00 +0100)]
Acpi userland: adapt to 20110211 upgrade and sync with FreeBSD 8.0

* acpiconf: show V/A battery units
* acpidump: add SRAT table support (FreebSD sync), untested

3 years agoSome minor changes
Magliano Andrea [Tue, 1 Mar 2011 09:03:14 +0000 (10:03 +0100)]
Some minor changes

* use AcpiUpdateAllGpes() (from FreeBSD 8.0)

* ACPI_THREAD_ID type is no longer configurable

* sync AcpiOsReadPciConfiguration with FreeBSD 8.0
  (and simplify bitmasking)

* because of AcpiOsDerivePciId() API removal, acpi_bus_number() is
  no longer needed

3 years agoDon't leave Value32 uinitialized (as it's not completely filled)
Magliano Andrea [Tue, 1 Mar 2011 07:42:05 +0000 (08:42 +0100)]
Don't leave Value32 uinitialized (as it's not completely filled)

OsdHardware.c:AcpiOsReadPort() casts Value to (u_int8_t *) resp.
(u_int16_t *) when assigning, thus leaving the upper region of Value32
untouched. If Value32 isn't initialized, random data remains trashing
the whole value.

Without this every bus_space_read_[12] is virtually screwed up.

3 years agoFurther acpica 20110211 code cleanup
Magliano Andrea [Tue, 1 Mar 2011 07:29:37 +0000 (08:29 +0100)]
Further acpica 20110211 code cleanup

In some files from the original taball, code was repeated n times
(this one was overseen)

3 years agoacpi: sync GPE with FreeBSD 8.0 (and according the acpi api)
Magliano Andrea [Thu, 24 Feb 2011 16:37:44 +0000 (17:37 +0100)]
acpi: sync GPE with FreeBSD 8.0 (and according the acpi api)

* use AcpiSetGpeWakeMask(), as AcpiEnableGpe() is already done in
  embedded controller initialization code. AcpiSetGpeWakeMask()
  is needed anyway to mark the gpe as wakable.
  (AcpiEnableGpe() enableas automatically only runtime GPEs now)

* using AcpiFinishGpe() in EcGpeQueryHandler() (as fbsd does) seems
  to make the system reactive as it should (was sensibly slowly
  without that)

3 years agoBring in acpica 20110211, still not ok anyway
Magliano Andrea [Tue, 22 Feb 2011 22:54:23 +0000 (23:54 +0100)]
Bring in acpica 20110211, still not ok anyway

(partially) sync with FreeBSD 8:
  * AcpiWalkNamespace post callbacks
  * wakable GPEs in acpi_probe_child()

problems:
  * system reacts slowly
  * temp reads nonsense values

3 years agokernel - Major bridging functionality added (bug fixes 5)
Matthew Dillon [Sun, 27 Mar 2011 02:17:55 +0000 (19:17 -0700)]
kernel - Major bridging functionality added (bug fixes 5)

* Consolidate the unicast target interface selection code into a single
  routine.

* bridge_start() now calls the unicast target interface selection routine.
  Prior to this packets originated on the machine containing the bridge
  were not selecting the proper target interface when bonding was operational,
  and would also not select a backup interface if the learned target
  interface went offline.

* Add some debug calls to mbuftrackid()

3 years agomemoryallocators.9: Some small cleanup.
Sascha Wildner [Sat, 26 Mar 2011 22:40:55 +0000 (23:40 +0100)]
memoryallocators.9: Some small cleanup.

3 years agokernel - Change mbuf allocation in tapwrite/tunwrite path to blocking
Matthew Dillon [Sat, 26 Mar 2011 22:15:34 +0000 (15:15 -0700)]
kernel - Change mbuf allocation in tapwrite/tunwrite path to blocking

* Tapwrite and tunwrite are called via userland, a blocking mbuf allocation
  is perfectly acceptable here and avoids dropping packets unnecessarily.

* Fixes numerous spurious packet drops when using TAP or TUN, for example
  with openvpn.

* Minor code cleanup in if_tap.c

3 years agokernel - Major bridging functionality added (bug fixes 4)
Matthew Dillon [Sat, 26 Mar 2011 19:39:23 +0000 (12:39 -0700)]
kernel - Major bridging functionality added (bug fixes 4)

* Fix an issue where we were assuming that a root bridge receiving a
  configuration packet from a remote bridge would get a path cost
  that already include the root bridge's path cost for that port.
  In fact the target bridge only includes an aggregate path cost to
  root (typically the lowest path cost of all the target bridge's
  ports), which is a fixed value.

* The root bridge must add the local path cost back in.

3 years agokiconv(3): Raise WARNS to 3 and fix some warnings.
Sascha Wildner [Sat, 26 Mar 2011 18:36:39 +0000 (19:36 +0100)]
kiconv(3): Raise WARNS to 3 and fix some warnings.

3 years agokernel build: msdosfs is no longer warning, so remove 'nowerror'.
Sascha Wildner [Sat, 26 Mar 2011 05:16:16 +0000 (06:16 +0100)]
kernel build: msdosfs is no longer warning, so remove 'nowerror'.

3 years agokernel - Fix MP race in vmspace_president_count() (2)
Matthew Dillon [Fri, 25 Mar 2011 21:38:35 +0000 (14:38 -0700)]
kernel - Fix MP race in vmspace_president_count() (2)

* Fix bug in last commit related to buildworld also wanting to use
  the inline functions in vm_map.h

Reported-by: Magliano Andrea <masterblaster@tiscali.it>
3 years ago/usr/Makefile: Use ${GITHOST} for the shallow clone too.
Sascha Wildner [Fri, 25 Mar 2011 18:51:13 +0000 (19:51 +0100)]
/usr/Makefile: Use ${GITHOST} for the shallow clone too.

Reported-by: John Marino <john@marino.st>
3 years agoioapic: Properly log interrupt mode
Sepherosa Ziehau [Fri, 25 Mar 2011 14:42:02 +0000 (22:42 +0800)]
ioapic: Properly log interrupt mode

3 years ago8254: Don't setup 8254 interrupt, if it is not selected as interrupt cputimer
Sepherosa Ziehau [Fri, 25 Mar 2011 13:54:30 +0000 (21:54 +0800)]
8254: Don't setup 8254 interrupt, if it is not selected as interrupt cputimer

8254 interrupt is setup, mainly to support C-state > C1, however, on some
systems it could cause system freezing during boot.  Change the default value
of hw.i8254.intr_disable to 1, so more systems could boot by default.

3 years agoacpi: Parse FADT to extract SCI IRQ number
Sepherosa Ziehau [Fri, 25 Mar 2011 13:50:53 +0000 (21:50 +0800)]
acpi: Parse FADT to extract SCI IRQ number

3 years agoioapic: Don't assert that interrupt mode are level/low or edge/high
Sepherosa Ziehau [Fri, 25 Mar 2011 13:04:38 +0000 (21:04 +0800)]
ioapic: Don't assert that interrupt mode are level/low or edge/high

For ACPI SCI, other combinations may be used by brain damaged BIOSes.

3 years agoacpi: Factor out SDT functions to locate specified SDT
Sepherosa Ziehau [Thu, 24 Mar 2011 13:20:51 +0000 (21:20 +0800)]
acpi: Factor out SDT functions to locate specified SDT

3 years agomadt: File relocate
Sepherosa Ziehau [Thu, 24 Mar 2011 11:18:40 +0000 (19:18 +0800)]
madt: File relocate

In preparation for FADT parsing

3 years agomadt: Configure interrupt trigger mode does not work quite well yet.
Sepherosa Ziehau [Thu, 24 Mar 2011 11:05:41 +0000 (19:05 +0800)]
madt: Configure interrupt trigger mode does not work quite well yet.

One of my system has interrupt storm on ACPI SCI (irq 9) after
change ACPI SCI mode to level/low (was edge/high).

3 years agoioapic: Allow interrupt trigger mode override in MADT
Sepherosa Ziehau [Wed, 23 Mar 2011 14:33:52 +0000 (22:33 +0800)]
ioapic: Allow interrupt trigger mode override in MADT

3 years agoapic/i386: Wait APs's LAPIC to be initialized before programming I/O APIC
Sepherosa Ziehau [Fri, 25 Mar 2011 12:24:46 +0000 (20:24 +0800)]
apic/i386: Wait APs's LAPIC to be initialized before programming I/O APIC

3 years agoapic/x86_64: Wait APs's LAPIC to be initialized before programming I/O APIC
Sepherosa Ziehau [Thu, 24 Mar 2011 14:45:43 +0000 (22:45 +0800)]
apic/x86_64: Wait APs's LAPIC to be initialized before programming I/O APIC

3 years agokernel - Fix MP race in vmspace_president_count()
Matthew Dillon [Fri, 25 Mar 2011 06:25:05 +0000 (23:25 -0700)]
kernel - Fix MP race in vmspace_president_count()

* We must get at least a shared vm_map lock in order to scan the
  vm_map_entry list.

* Cache the totaled value and use it for repeated requests within one
  second or if the vm_map lock could not be acquired non-blocking.

* The bug being fixed could be triggered by top.

3 years agoobjformat(1): Fix whitespace in the Makefile.
Sascha Wildner [Fri, 25 Mar 2011 06:14:56 +0000 (07:14 +0100)]
objformat(1): Fix whitespace in the Makefile.

3 years agoHook binutils 2.21 into the build in place of 2.20.
Sascha Wildner [Thu, 24 Mar 2011 21:02:35 +0000 (22:02 +0100)]
Hook binutils 2.21 into the build in place of 2.20.

Submitted-by: John Marino <john@marino.st>
3 years agoHAMMER VFS - Fix incorrect reflush conditional
Matthew Dillon [Fri, 25 Mar 2011 04:02:35 +0000 (21:02 -0700)]
HAMMER VFS - Fix incorrect reflush conditional

* Fix a conditional that was testing the wrong field when determining
  how to reflush a directory or regular file.  This could prevent sync
  sequences from properly syncing the entire dependency chain during
  heavy filesystem activity.

* No known bugs are related to this fix as the chains would get flushed
  normally by the filesystem syncer eventually.

Reported-by: Sascha Wildner <saw@online.de>
3 years agovkernel - test/vkernel 'scratch' target missing root build
Matthew Dillon [Thu, 24 Mar 2011 23:46:06 +0000 (16:46 -0700)]
vkernel - test/vkernel 'scratch' target missing root build

* Add the 'root' target to the 'scratch' target at the appropriate
  place, it was missing.

3 years agokernel - Revamp LWKT thread migration
Matthew Dillon [Thu, 24 Mar 2011 21:40:08 +0000 (14:40 -0700)]
kernel - Revamp LWKT thread migration

* Rearrange the handling of TDF_RUNNING, making lwkt_switch() responsible
  for it instead of the assembly switch code.  Adjust td->td_switch() to
  return the previously running thread.

  This allows lwkt_switch() to process thread migration between cpus after
  the thread has been completely and utterly switched out, removing the
  need to loop on TDF_RUNNING on the target cpu.

* Fixes lwkt_setcpu_remote livelock failure

* This required major surgery on the core thread switch assembly, testing
  is needed.  I tried to avoid doing this but the livelock problems persisted,
  so the only solution was to remove the need for the loops that were causing
  the livelocks.

* NOTE: The user process scheduler is still using the old giveaway/acquire
method.  More work is needed here.

Reported-by: "Magliano Andre'" <masterblaster@tiscali.it>
3 years agokernel - Silence warnings from older gcc
Matthew Dillon [Thu, 24 Mar 2011 20:16:52 +0000 (13:16 -0700)]
kernel - Silence warnings from older gcc

* Silence a warning (fatal) during the kernel build when building with
  an older gcc.  The code itself was correct.

3 years agoobjformat(1): Remove gdb from the list. Not part of binutils.
Sascha Wildner [Thu, 24 Mar 2011 17:52:03 +0000 (18:52 +0100)]
objformat(1): Remove gdb from the list. Not part of binutils.

3 years agoRemove the remains of the removal of gasp in binutils 2.13 years ago.
Sascha Wildner [Thu, 24 Mar 2011 16:57:11 +0000 (17:57 +0100)]
Remove the remains of the removal of gasp in binutils 2.13 years ago.

3 years agoREADME: I removed a bit too much.
Sascha Wildner [Thu, 24 Mar 2011 13:29:32 +0000 (14:29 +0100)]
README: I removed a bit too much.

3 years agoFix some more the the typos.
Sascha Wildner [Thu, 24 Mar 2011 13:21:32 +0000 (14:21 +0100)]
Fix some more the the typos.

3 years agomille: Fix typo.
Peter Avalos [Wed, 23 Mar 2011 06:05:19 +0000 (17:05 +1100)]
mille: Fix typo.

3 years agosh: Fix typo in comment.
Peter Avalos [Sat, 5 Mar 2011 22:54:35 +0000 (12:54 -1000)]
sh: Fix typo in comment.

Obtained-from: FreeBSD

3 years agoRemove a years old attempt at a BSD licensed libiberty.
Sascha Wildner [Wed, 23 Mar 2011 22:40:20 +0000 (23:40 +0100)]
Remove a years old attempt at a BSD licensed libiberty.

This never gained traction and was never part of the build.

Since libiberty is only used by the GNU toolchain (included in binutils*,
gcc* and gdb), and given that the real work with the toolchain certainly
isn't in libiberty related things, this can go.

3 years agobinutils221: Fix some copy/paste errors.
Sascha Wildner [Wed, 23 Mar 2011 21:25:14 +0000 (22:25 +0100)]
binutils221: Fix some copy/paste errors.

3 years agobinutils221: Add the gnu/ building hierarchy.
Sascha Wildner [Wed, 23 Mar 2011 21:12:23 +0000 (22:12 +0100)]
binutils221: Add the gnu/ building hierarchy.

Submitted-by: John Marino <john@marino.st>
3 years agobinutils221: Fix an error and a warning.
Sascha Wildner [Wed, 23 Mar 2011 20:58:30 +0000 (21:58 +0100)]
binutils221: Fix an error and a warning.

Submitted-by: John Marino <john@marino.st>
3 years agobinutils221: Add some generated manual pages.
Sascha Wildner [Wed, 23 Mar 2011 20:56:12 +0000 (21:56 +0100)]
binutils221: Add some generated manual pages.

Submitted-by: John Marino <john@marino.st>
3 years agobinutils221: Add some DragonFly specific configuration stuff.
Sascha Wildner [Wed, 23 Mar 2011 20:50:50 +0000 (21:50 +0100)]
binutils221: Add some DragonFly specific configuration stuff.

Submitted-by: John Marino <john@marino.st>
3 years agobinutils221: Bring in some needed files instead of generating them.
Sascha Wildner [Wed, 23 Mar 2011 20:46:44 +0000 (21:46 +0100)]
binutils221: Bring in some needed files instead of generating them.

Submitted-by: John Marino <john@marino.st>
3 years agobinutils221: Add our READMEs.
Sascha Wildner [Wed, 23 Mar 2011 20:40:55 +0000 (21:40 +0100)]
binutils221: Add our READMEs.

Submitted-by: John Marino <john@marino.st>
3 years agoMerge branch 'vendor/BINUTILS221'
Sascha Wildner [Wed, 23 Mar 2011 20:14:59 +0000 (21:14 +0100)]
Merge branch 'vendor/BINUTILS221'

3 years agobinutils221: Bring in some more files on the vendor branch.
Sascha Wildner [Wed, 23 Mar 2011 20:13:13 +0000 (21:13 +0100)]
binutils221: Bring in some more files on the vendor branch.

3 years agoMerge branch 'vendor/BINUTILS221'
Sascha Wildner [Wed, 23 Mar 2011 19:23:06 +0000 (20:23 +0100)]
Merge branch 'vendor/BINUTILS221'

3 years agoImport binutils-2.21
Sascha Wildner [Wed, 23 Mar 2011 19:22:22 +0000 (20:22 +0100)]
Import binutils-2.21

3 years agoAdd memoryallocators(9) manpage to describe kernel memory allocators.
Venkatesh Srinivas [Wed, 23 Mar 2011 18:11:30 +0000 (11:11 -0700)]
Add memoryallocators(9) manpage to describe kernel memory allocators.

3 years agokernel - Major bridging functionality added (bug fixes 3)
Matthew Dillon [Wed, 23 Mar 2011 16:36:33 +0000 (09:36 -0700)]
kernel - Major bridging functionality added (bug fixes 3)

* When forwarding packets we do not retransmit the packet out the same
  interface it came in on, but this check was not taking into account
  bonding sets and could bounce a packet out a different interface on the
  same bonding set the packet came in on.

  This could result in loops for things like ARP broadcasts and cause
  intermediate ethernet switches to get confused as to which port a
  particular MAC is on.

* Change src_if == dst_if checks to compare MAC addresses instead, which
  solves the problem.

3 years agomptable: Make interrupt routing information logging consistent with PIR
Sepherosa Ziehau [Wed, 23 Mar 2011 12:41:02 +0000 (20:41 +0800)]
mptable: Make interrupt routing information logging consistent with PIR

3 years agoioapic: Raise MADT I/O APIC enumerator priority
Sepherosa Ziehau [Wed, 23 Mar 2011 12:33:35 +0000 (20:33 +0800)]
ioapic: Raise MADT I/O APIC enumerator priority

3 years agoioapic: Disable imen_dump() in new code
Sepherosa Ziehau [Wed, 23 Mar 2011 12:26:55 +0000 (20:26 +0800)]
ioapic: Disable imen_dump() in new code

3 years agoioapic: Rework I/O APIC APIC ID allocation
Sepherosa Ziehau [Wed, 23 Mar 2011 12:04:15 +0000 (20:04 +0800)]
ioapic: Rework I/O APIC APIC ID allocation

- I/O APIC's ID field in ID register contains only 4bits, so only 16
  I/O APICs should be allowed.
- All I/O APIC's APIC ID's lower 4bits (what we wrote to I/O APIC ID
  register) must be different from each other, this should be done
  even on xAPIC (e.g. Pentium 4), where I/O APIC's APIC IDs are not
  required to be different from what LAPIC's.

3 years agoioapic: Don't assume that BSP's APIC ID is 0
Sepherosa Ziehau [Wed, 23 Mar 2011 10:54:33 +0000 (18:54 +0800)]
ioapic: Don't assume that BSP's APIC ID is 0

3 years agomsdosfs: use size_t for unlen consistently instead of int.
Alexander Polakov [Mon, 21 Mar 2011 23:00:15 +0000 (02:00 +0300)]
msdosfs: use size_t for unlen consistently instead of int.

size_t is different from int on x86-64, which can lead
to weird effects.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2027>

3 years agoacpi/x86_64: Properly configure ACPI interrupt model
Sepherosa Ziehau [Tue, 22 Mar 2011 11:10:07 +0000 (19:10 +0800)]
acpi/x86_64: Properly configure ACPI interrupt model

3 years agokernel - Reduce dsched console output
Matthew Dillon [Mon, 21 Mar 2011 21:36:24 +0000 (14:36 -0700)]
kernel - Reduce dsched console output

* Only print out 'No policy for ...' messages if bootverbose is set.

3 years agoioapic: Switch to new code by default
Sepherosa Ziehau [Mon, 21 Mar 2011 16:52:42 +0000 (00:52 +0800)]
ioapic: Switch to new code by default

3 years agoioapic: For limited I/O APIC mixed mode, delivery mode should always be fixed.
Sepherosa Ziehau [Mon, 21 Mar 2011 16:55:51 +0000 (00:55 +0800)]
ioapic: For limited I/O APIC mixed mode, delivery mode should always be fixed.

3 years ago8254: Setup interrupt properly for new I/O APIC code
Sepherosa Ziehau [Mon, 21 Mar 2011 16:06:30 +0000 (00:06 +0800)]
8254: Setup interrupt properly for new I/O APIC code

3 years ago8254: apic_8254_intr does not need to be global variable
Sepherosa Ziehau [Mon, 21 Mar 2011 14:39:16 +0000 (22:39 +0800)]
8254: apic_8254_intr does not need to be global variable

3 years agoemul/linux: Unbreak module building
Sepherosa Ziehau [Mon, 21 Mar 2011 13:58:04 +0000 (21:58 +0800)]
emul/linux: Unbreak module building

3 years agomptable: Verbose debug logging about "fixed interrupt routing"
Sepherosa Ziehau [Mon, 21 Mar 2011 13:41:31 +0000 (21:41 +0800)]
mptable: Verbose debug logging about "fixed interrupt routing"

3 years agoioapic: Don't allow interrupt source overrides to GSI 0 (ExtINT)
Sepherosa Ziehau [Mon, 21 Mar 2011 13:25:07 +0000 (21:25 +0800)]
ioapic: Don't allow interrupt source overrides to GSI 0 (ExtINT)

3 years agobinutils220: Fix a copy/paste error.
Sascha Wildner [Sun, 20 Mar 2011 15:28:32 +0000 (16:28 +0100)]
binutils220: Fix a copy/paste error.

Reported-by: John Marino <john@marino.st>
3 years agobinutils: Install the manpages of both binutils versions.
Sascha Wildner [Sun, 20 Mar 2011 12:57:56 +0000 (13:57 +0100)]
binutils: Install the manpages of both binutils versions.

Previously, 2.20's manpages were just copied over 2.17's.

Now it is like with gcc and friends: Install as ld217.1 and ld220.1,
for example, and use a ld.1 MLINKS for the default binutils.

Reported-by: John Marino <john@marino.st>
3 years agogcc44: Switch the rest of the MLINKS over to gcc44.
Sascha Wildner [Sun, 20 Mar 2011 10:49:48 +0000 (11:49 +0100)]
gcc44: Switch the rest of the MLINKS over to gcc44.

3 years agogcc44: Add a forgotten '+'.
Sascha Wildner [Sun, 20 Mar 2011 10:49:10 +0000 (11:49 +0100)]
gcc44: Add a forgotten '+'.

3 years agomptable: Always clear 'force_pci0' before setting/using it
Sepherosa Ziehau [Sun, 20 Mar 2011 07:56:02 +0000 (15:56 +0800)]
mptable: Always clear 'force_pci0' before setting/using it

3 years agomptable/ioapic: Properly routing PCI interrupts
Sepherosa Ziehau [Sun, 20 Mar 2011 06:40:30 +0000 (14:40 +0800)]
mptable/ioapic: Properly routing PCI interrupts

3 years agoioapic/abi: Mark unused ISA IRQs as reserved
Sepherosa Ziehau [Sun, 20 Mar 2011 04:37:45 +0000 (12:37 +0800)]
ioapic/abi: Mark unused ISA IRQs as reserved

3 years agoioapic: Let callers of pin_setup() to hold imen_spinlock
Sepherosa Ziehau [Sun, 20 Mar 2011 04:15:34 +0000 (12:15 +0800)]
ioapic: Let callers of pin_setup() to hold imen_spinlock

3 years agobinutils: Offer both readelf(1)'s based on BINUTILSVER's setting.
Sascha Wildner [Sat, 19 Mar 2011 15:57:27 +0000 (16:57 +0100)]
binutils: Offer both readelf(1)'s based on BINUTILSVER's setting.

Reported-by: John Marino <john@marino.st>
3 years agoioapic: Move MachIntrABI switching from ABI finalize to I/O APIC configure
Sepherosa Ziehau [Sat, 19 Mar 2011 11:11:10 +0000 (19:11 +0800)]
ioapic: Move MachIntrABI switching from ABI finalize to I/O APIC configure

3 years agoFix loading of a kernel that was linked with ld 2.20 on x86_64.
Sascha Wildner [Fri, 18 Mar 2011 21:05:22 +0000 (22:05 +0100)]
Fix loading of a kernel that was linked with ld 2.20 on x86_64.

The MAXPAGESIZE changed between binutils 2.17 and 2.20 from 0x100000
to 0x200000 for x86_64. But we have 0x100000 coded into our ldscript
for the kernel.

The real solution would be to specify "CONSTANT (MAXPAGESIZE)" in
the ldscript but unfortunately binutils 2.17 (at least our version;
later snapshots like 2.17.50 or 2.17.90 do) doesn't have support for
this keyword.

We will do that too once we get rid of binutils 2.17. Until then,
set max-page-size to 0x100000 as a workaround when linking on
x86_64.

3 years agoFix buildkernel without -j.
Sascha Wildner [Sat, 19 Mar 2011 08:17:29 +0000 (09:17 +0100)]
Fix buildkernel without -j.

One of the recent commits by sephe caused genassym.c to depend on
bus_if.h and device_if.h (via machintr.h via bus.h).

However, without -j, these headers would not be generated (from
the .m files) before genassym.c was compiled, causing the kernel
build to break.

As a fix, make genassym.c depend on these headers in the Makefile.

The interesting bit is that this is one of the cases where it
breaks without -j but _does_ work with -j 1 (read: one) due to
the different handling of no -j vs. -j 1 in make(1).

3 years agoapic: Initialize LAPIC before programming I/O APIC
Sepherosa Ziehau [Sat, 19 Mar 2011 07:47:20 +0000 (15:47 +0800)]
apic: Initialize LAPIC before programming I/O APIC

On the system without IMCR, I/O APIC is enabled when it is first accessed.
Before I/O APIC is enabled, LAPIC should be initialized.

3 years agolapic: Centralize LAPIC configuration
Sepherosa Ziehau [Sat, 19 Mar 2011 07:28:54 +0000 (15:28 +0800)]
lapic: Centralize LAPIC configuration

3 years agolapic_init: Use 'bsp' function parameter consistently
Sepherosa Ziehau [Sat, 19 Mar 2011 06:56:16 +0000 (14:56 +0800)]
lapic_init: Use 'bsp' function parameter consistently

3 years agolapic: Move LAPIC related vector installation into lapic_init()
Sepherosa Ziehau [Sat, 19 Mar 2011 06:46:36 +0000 (14:46 +0800)]
lapic: Move LAPIC related vector installation into lapic_init()

3 years agolapic: apic_initialize() -> lapic_init()
Sepherosa Ziehau [Sat, 19 Mar 2011 06:34:07 +0000 (14:34 +0800)]
lapic: apic_initialize() -> lapic_init()

3 years agoapic: Centralize IMCR present setting
Sepherosa Ziehau [Sat, 19 Mar 2011 05:19:35 +0000 (13:19 +0800)]
apic: Centralize IMCR present setting

3 years agoclock: Use irq number; More consistent with the above register_int()
Sepherosa Ziehau [Fri, 18 Mar 2011 14:48:00 +0000 (22:48 +0800)]
clock: Use irq number; More consistent with the above register_int()

3 years agokernel: Fix -Wundef in a number of places.
Sascha Wildner [Fri, 18 Mar 2011 19:41:31 +0000 (20:41 +0100)]
kernel: Fix -Wundef in a number of places.

3 years agoHook some forgotten Citrus tools into the build.
Sascha Wildner [Fri, 18 Mar 2011 17:49:27 +0000 (18:49 +0100)]
Hook some forgotten Citrus tools into the build.

3 years agoioapic/abi: Log interrupt trigger mode changes
Sepherosa Ziehau [Fri, 18 Mar 2011 14:23:48 +0000 (22:23 +0800)]
ioapic/abi: Log interrupt trigger mode changes

It is mainly used to locate missing bus_config_intr call

3 years agoicu/abi: Fix typo
Sepherosa Ziehau [Fri, 18 Mar 2011 14:08:44 +0000 (22:08 +0800)]
icu/abi: Fix typo

3 years agomptable/pci: Configure interrupts after routing
Sepherosa Ziehau [Fri, 18 Mar 2011 09:52:52 +0000 (17:52 +0800)]
mptable/pci: Configure interrupts after routing

3 years agonexus: Implement bus_config_intr bus method
Sepherosa Ziehau [Fri, 18 Mar 2011 09:52:29 +0000 (17:52 +0800)]
nexus: Implement bus_config_intr bus method

3 years agomachintr: Add intr_config interface
Sepherosa Ziehau [Fri, 18 Mar 2011 09:05:44 +0000 (17:05 +0800)]
machintr: Add intr_config interface

This interface is used to change pre-configured interrupt's trigger
mode and polarity.

3 years agoioapic: Properly setup I/O APIC pin according to the saved information
Sepherosa Ziehau [Fri, 18 Mar 2011 07:17:39 +0000 (15:17 +0800)]
ioapic: Properly setup I/O APIC pin according to the saved information

3 years agoioapic/abi: Save IRQ to GSI mapping
Sepherosa Ziehau [Fri, 18 Mar 2011 05:59:50 +0000 (13:59 +0800)]
ioapic/abi: Save IRQ to GSI mapping