already. This allows to detect invalid settings before starting to enable
IRQ routing and therefore allows to gracefully fall back to PIC mode on error.
* Actually read the number of IO-APIC entries before using that number in
routing preparation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41416 a95241bf-73f2-0310-859d-f6bbb57e9c96
gracefully in such cases (resulting in the IO-APIC not being used).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41415 a95241bf-73f2-0310-859d-f6bbb57e9c96
vectors at all. It'd also not work for multi IO-APIC setups which we don't
support yet (but are relatively rare anyway).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41414 a95241bf-73f2-0310-859d-f6bbb57e9c96
hardwired GSIs and updated on configuring the link devices, is used for that.
This doesn't guarantee optimal results as some link devices may not be
configurable to some IRQs and we might fill up their slots this way. Most of
the time this should be good enough though.
* Take the BIOS assigned IRQ white list into account when assigning IRQs in the
ISA range and avoid assigning to non white listed IRQs. Quite probably it'd be
ok to use all of the IRQs present in the possible IRQ list, but let's play it
safe...
* Also white listed are the IRQs that were set on the link device before
reconfiguration.
* Some cleanup, use references instead of pointers where applicable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41401 a95241bf-73f2-0310-859d-f6bbb57e9c96
configuration that doesn't require any link device changes and will only
prepare for updating the pci_info. Enabling then does the link device setup
and updates the pci_info with the new IRQ values.
* Configuring link devices now takes into account that multiple devices may
share a single link device, meaning that the sharing PCI devices can't be
configured independently.
We still only blindly configure the first possible IRQ on the link devices, but
now we actually have all the information to change that. Working on that next.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41400 a95241bf-73f2-0310-859d-f6bbb57e9c96
independently. Matching will happen first to enumerate and match all devices.
Updating will happen after configuring all link devices, so once we know the
final GSI of all entries. The info about matching functions is kept in a
bitmask in the table entry.
* Move routing table entry handling out of the loop into it's own function to
faciliate early returns.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41399 a95241bf-73f2-0310-859d-f6bbb57e9c96
Those can be used to white list PCI IRQs in ISA space (<= 15) as those are
basically guaranteed not to overlap with ISA devices. Those white listed entries
can then be used if we only have a 16 pin IO-APIC or if there are only legacy
IRQ resources available for configuration (i.e. ones with bitmasks of 16 bits,
limiting their range to IRQs 0-15).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41397 a95241bf-73f2-0310-859d-f6bbb57e9c96
using the already parsed pci_info data from the PCI module. This removes the
need to iterate over all of the pci_infos for each routing table entries which
makes this an order of magnitude less expensive. Heavily inspired by the
corresponding FreeBSD code.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41395 a95241bf-73f2-0310-859d-f6bbb57e9c96
duplicating the structs on our side. IRQ assignment didn't work with extended
IRQ resources because the alignment of the structs were different in our local
duplicates...
Brings in the ACPICA naming sheme and isn't really clean either. So all of the
reconfiguration should probably just be moved into the ACPI bus_manager.
On the plus side we can now use the proper descriptive macros instead of the
hardcoded numbers which fixes a few of the TODOs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41393 a95241bf-73f2-0310-859d-f6bbb57e9c96
* increase _SYS_NAMELEN defined in sys/utsname.h to 128 to allow long(ish) revisions
* sHaikuRevision is now a static character array (in both libroot and kernel)
* adjust build tool set_haiku_revision to write the revision as string
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41389 a95241bf-73f2-0310-859d-f6bbb57e9c96
the first possible configuration. This will probably result in a "everything
mapped to a single IRQ" situation, but should get systems that make use of link
devices in APIC mode at least running.
To make more sensible decisions the interface has to be changed next as it
currently doesn't allow to get anything but the very first possible config.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41384 a95241bf-73f2-0310-859d-f6bbb57e9c96
resources we input the desired configuration and then set them. Note that the
set_current_resources() ("_SRS") method is pretty picky (on the low-level ACPI
side) and needs the configuration in exactly the form get_current_resources()
("_CRS") returns, so that's why we need to utilize that buffer as a template.
Looking at FreeBSD there seem to be systems that don't actually provide a
"_CRS", where we will need to fall back to using the get_possible_resources()
("_PRS") data to construct a valid template...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41383 a95241bf-73f2-0310-859d-f6bbb57e9c96
for the introduced get_pci_info() method in ACPI as it doesn't work reliably.
The new version should be more robust and efficient as it only resolves the
root bridge values once.
* Don't try to read and use the secondary bus register for the root bridge as
it isn't actually a normal bridge. We get the root bridge bus by using the
Base Bus Number (_BBN) method.
* Rewrite the logic to recurse down to all busses.
* Minor debug output changes to make the info more readable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41371 a95241bf-73f2-0310-859d-f6bbb57e9c96
IO-APIC can be easily enabled to test it on various configurations. Note that
the previous default opt-out didn't work because the safemode options would not
be touched at all when not actually entering the boot menu.
Once IO-APIC is more broadly tested this can be removed again and the opt-out
option reenabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41370 a95241bf-73f2-0310-859d-f6bbb57e9c96
to PCI devices partly using the new ACPI interface and by using bridge config
information from PCI.
* Added lookup of matching device/pin combinations and update of the relevant
interrupt line variable via the new PCI module function. This means that the
Global System Interrupt (GSI) that is used after switching to the IO-APIC is
now stored in the PCI config space and drivers enumerating these devices will
now attach their interrupt handlers to the right IRQs.
* Resolve all relevant interrupt information directly into the irq_routing_entry
so that can be used as the single source for config information. This includes
resolving the current setting of any PCI link devices into the irq field that
represents a GSI now.
* Use that info to configure interrupts in arch_int.cpp and remove the logic
there.
* Some cleanup and added debug output.
This implements the final missing part for using IO-APICs and full APIC mode for
interrupt routing. Note that there is no quirk handling of any form, so this
may very well not work on some configurations. Note also that I have tested this
only on one machine so far. Once proper testing is done the default of disabling
the IO-APIC can be removed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41367 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Remove wrong extra line when printing an irq_descriptor.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41339 a95241bf-73f2-0310-859d-f6bbb57e9c96
correct PCI IRQ routing table for that mode. With this, we finally get the right
PIRQ <-> Global System Interrupt mapping and can therefore program the right
IO APIC entries. The only missing part now is to fix up the pci_info of the
devices with the then active GSI.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41338 a95241bf-73f2-0310-859d-f6bbb57e9c96
* The irq values we get from ACPICA are already converted, remove the wrong
extra conversion from bitfield to irq number.
* Add and handle extended irq structures.
* Disable the legacy PIC when done configuring the IOAPIC. Since during that
configuration the ACPI module is initialized, the ACPI SCI is still enabled
in the PIC instead of the IOAPIC. We'll have to delay that routing in the
ACPI module for it to work.
* Correctly handle the fixed IRQ case for the PCI interrupt routing (hopefully).
* Actually allow for enumeration of possible IRQ settings. Not yet used though.
All of this brings us a bit closer, though it still won't work for PCI
interrupts. ISA interrupts work fine through the IOAPIC as far as my hardware
goes, but PCI interrupts are connected to dedicated IOAPIC pins and I still
haven't figured out how to determine their exact routing.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41328 a95241bf-73f2-0310-859d-f6bbb57e9c96
unload a driver. This was causing bug #4608 depending on the order of events;
now you should have less worries removing your USB device before having it
unmounted.
* Added a "legacy_device" KDL command.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41119 a95241bf-73f2-0310-859d-f6bbb57e9c96
a problem on the Mac which obviously messed up its BIOS.
* This busy loops, but CPU utilization should be a maxed out in the boot loader
anyway - we could add a pause, though.
* This closes bug #2654.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41117 a95241bf-73f2-0310-859d-f6bbb57e9c96
the state of the ARM port to booting all the way up to the idle thread again.
However, will still need to investigate why we need the PHDRS magic, likely due to improper
setup of the ARM toolchain. If anyone has ideas, please let me know!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40937 a95241bf-73f2-0310-859d-f6bbb57e9c96
Another way would be to disallow removing such a path, as Linux does.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40819 a95241bf-73f2-0310-859d-f6bbb57e9c96
(now at least <std> and <offset> are supported properly)
* instead of creating a TimeZone object whenever needed, we now
create it in tzset() and keep it around
* add tests for TZ to locale_test
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40788 a95241bf-73f2-0310-859d-f6bbb57e9c96
* in case fd_ioctl() was about to return B_DEV_INVALID_IOCTL, translate to ENOTTY to satisfy #7279.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40787 a95241bf-73f2-0310-859d-f6bbb57e9c96
(Note, I honestly have no idea what was initially wrong with the code; everything seamt right to me..)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40676 a95241bf-73f2-0310-859d-f6bbb57e9c96