History log of /haiku/headers/private/kernel/int.h
Revision Date Author Comments
# 02463fb4 05-Mar-2024 X512 <danger_mail@list.ru>

kernel/int: consolidate interrupt vector number to `int32`

This is no-op for 32 bit platforms because `int32` is defined as `long` there.

Change interrupt vector number from 64 bits to 32 bits for 64 bit platforms.

Change-Id: I52d1ad616cab16488804e9733c7afaf772a670ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7507
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 66395144 19-Dec-2013 Pawel Dziepak <pdziepak@quarnos.org>

x86[_64]: Support assigning MSI IRQs to arbitrary CPU


# d897a478 17-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Allow reassigning IRQs to logical processors


# 6a164daa 17-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Track load produced by interrupt handlers


# fc2d7cb0 12-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

* Introduce {reserve|allocate|free}_io_interrupt_vectors() that can generically
be used to mark certain io interrupt vectors as reserved and to allocate from
the still free ones. It is a kernel private API for now though.
* Make the MSI code use that functionality instead of implementing its own which
slims it down considerably and also removes quite a bit of hardcoded knowledge
about the interrupt layout that didn't really belong there.
* Mark the various in-use interrupts as reserved from the components that
actually know about them (PIC, IO-APIC, SMP, APIC timer and interrupt setup).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42832 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 45bd7bb3 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9de17be6 14-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved I/O APIC initialization to a later point, now the APCI and DPC modules
can safely be used.
* Since using the I/O APIC is disabled by default, I've removed the "return"
that prevented its use when enabled. Let's see if it already does anything.
* Adapted other arch_int.cpp with a bit of cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36290 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3684e40b 17-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Introduce a (private) flag B_NO_HANDLED_INFO for install_io_interrupt_handler.
It causes the interrupt handler to be inserted at the very end of the list
instead of at the top. It is intended to be used as a workaround when a
interrupt handler cannot know if it actually handled the interrupt. This
should never be used by native drivers. Also if we know that the result is
not valid because of this flag we won't disable the vector in case we count
many unhandled interrupts as those numbers are then unreliable.
* Moved B_NO_LOCK_VECTOR to be a private flag as well.
* Made the interrupt handler list a simple manually maintaned singly linked list
instead of the doubly linked one used with insque and remque as it greatly
simplifies things for such an easy use case and is more compact.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29241 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 567f7889 01-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Fully inline {disable,restore}_interrupts() and friends when including
<int.h>. Performance-wise not really significant, but gives nicer
profiling results.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27827 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77a08c68 30-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Changed the way handlers for edge triggered interrupt are called: now, we
always call all handlers in this case, but we still try to return the correct
return code (ie. B_HANDLED_INTERRUPT and B_INVOKE_SCHEDULER).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f4b0f67c 06-Feb-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Added [arch_]int_post_device_manager() which is invoked after
the device manager is initialized. For x86 it does nothing, but
for PPC it searches for a supported interrupt controller and
remembers it for later use.
arch_int_{enable,disable}_io_interrupt() are implemented as
well as handling of external exceptions (aka as I/O interrupts).
We'll see later how well that works.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16271 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b20667b3 26-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

{install|remove}_io_interrupt_handler() now correctly handle the B_NO_ENABLE_COUNTER flag.
Lots of cleanup:
- moved B_NO_ENABLE_COUNTER flag definition out of int.h to KernelExport.h, as it's
described in the BeBook (although it's probably not really used that often :))
- int.c no longer has any platform dependent code (+ 0x20 on interrupt numbers is gone);
it's now entirely handled in the arch/x86/ section.
- the io_vectors[] is now statically initialized, instead of allocated from the heap
- removed {install|remove}_interrupt_handler(); they weren't that useful, arch_smp_init()
is now calling install_io_interrupt_handler() correctly instead
- introduced a new arch_int.h header file that currently contains NUM_IO_VECTORS only
(though on x86, it also has ARCH_INTERRUPT_BASE == 0x20).
- changed the return type from {install|remove}_io_interrupt_handler() from "long" to
"status_t"
- rearranged and cleaned the PIC initialization code, made the PIC code more prominent
- changed comments that talk about a non existing 8239 (the PIC chip is actually 8259)
- moved arch/x86/interrupts.h to the source directory, as it's not used outside
- added BeOS compatible interrupts_enabled() function, that should replace our
equivalent (and private) are_interrupts_enabled()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12477 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f80b1fa5 12-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Moved the kernel_startup variable declaration from int.h to kernel.h (it's defined in main.c).
Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12327 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74b043d9 17-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Removed execute property that was set accidently (since CVS days).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11896 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b0d8e689 20-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Renamed some more init2 routines to init_post_vm() to make it clearer when
and why they are called.
Introduced a cpu_init_post_vm() that will now call arch_init_post_vm() instead
of letting main() doing it.
Fixed some return types (mostly from int to status_t).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9438 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 229ad83b 28-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

Renamed arch_int_is_interrupts_enabled() to arch_int_are_interrupts_enabled().
Replaced definitions for enable_interrupts() and are_interrupts_enabled()
with static inlines.
Made int.h C++ safe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5190 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 564cba31 03-May-2003 Axel Dörfler <axeld@pinc-software.de>

Some header work: removed unnecessary dependencies to stage2.h, fixed
some broken C++ export definitions, added missing licenses etc.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3152 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7991b1a0 27-Nov-2002 beveloper <beveloper@nowhere.fake>

added a lot of debugging functions that should help fixing bugs


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2099 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5cdacbaa 26-Oct-2002 lillo <lillo@nowhere.fake>

*LOTS* of small changes to make the kernel compatible with Be's KernelExport.h


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1683 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ba192e3 24-Jul-2002 David Reid <dreid@nowhere.fake>

Remove the int_ from in front of the enable/disable interrupt functions.

These will need to be reviewed as beos drivers expect them to be available
and using #define won't cover that.

The doxygen stuff doesn't all work though I can't figure out why :(


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@423 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c6aa0539 19-Jul-2002 David Reid <dreid@nowhere.fake>

Add some new functions for the big change coming (again) for the
interrupt code. Also start adding doxygen comments :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@347 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca91310a 19-Jul-2002 David Reid <dreid@nowhere.fake>

Start the change to using beos style interrupt handlers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@336 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 663951443784bb63d60abe742f1d1379fb153e18 19-Dec-2013 Pawel Dziepak <pdziepak@quarnos.org>

x86[_64]: Support assigning MSI IRQs to arbitrary CPU


# d897a478d7c01054aad29b23f7f545073c797530 17-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Allow reassigning IRQs to logical processors


# 6a164daad43169daf0a407fb1f6b0484671ff466 17-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Track load produced by interrupt handlers


# fc2d7cb04d7ad78424169fd0df4d236de2bb17d1 12-Oct-2011 Michael Lotz <mmlr@mlotz.ch>

* Introduce {reserve|allocate|free}_io_interrupt_vectors() that can generically
be used to mark certain io interrupt vectors as reserved and to allocate from
the still free ones. It is a kernel private API for now though.
* Make the MSI code use that functionality instead of implementing its own which
slims it down considerably and also removes quite a bit of hardcoded knowledge
about the interrupt layout that didn't really belong there.
* Mark the various in-use interrupts as reserved from the components that
actually know about them (PIC, IO-APIC, SMP, APIC timer and interrupt setup).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42832 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 45bd7bb3db9d9e4dcb02b89a3e7c2bf382c0a88c 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9de17be600220db91400c27772b19546284f470f 14-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved I/O APIC initialization to a later point, now the APCI and DPC modules
can safely be used.
* Since using the I/O APIC is disabled by default, I've removed the "return"
that prevented its use when enabled. Let's see if it already does anything.
* Adapted other arch_int.cpp with a bit of cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36290 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3684e40bb8c7029820387ca4c8a63e252297e343 17-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Introduce a (private) flag B_NO_HANDLED_INFO for install_io_interrupt_handler.
It causes the interrupt handler to be inserted at the very end of the list
instead of at the top. It is intended to be used as a workaround when a
interrupt handler cannot know if it actually handled the interrupt. This
should never be used by native drivers. Also if we know that the result is
not valid because of this flag we won't disable the vector in case we count
many unhandled interrupts as those numbers are then unreliable.
* Moved B_NO_LOCK_VECTOR to be a private flag as well.
* Made the interrupt handler list a simple manually maintaned singly linked list
instead of the doubly linked one used with insque and remque as it greatly
simplifies things for such an easy use case and is more compact.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29241 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 567f78895b7878437f43d68fa3091b7bae47fa36 01-Oct-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Fully inline {disable,restore}_interrupts() and friends when including
<int.h>. Performance-wise not really significant, but gives nicer
profiling results.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27827 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77a08c68e82ceac8facad0be7cbd59ab471ecb1d 30-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Changed the way handlers for edge triggered interrupt are called: now, we
always call all handlers in this case, but we still try to return the correct
return code (ie. B_HANDLED_INTERRUPT and B_INVOKE_SCHEDULER).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f4b0f67cf6e58e58eab0e9fa52c5219b82673544 06-Feb-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Added [arch_]int_post_device_manager() which is invoked after
the device manager is initialized. For x86 it does nothing, but
for PPC it searches for a supported interrupt controller and
remembers it for later use.
arch_int_{enable,disable}_io_interrupt() are implemented as
well as handling of external exceptions (aka as I/O interrupts).
We'll see later how well that works.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16271 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b20667b35b3effbc937914eba73761f43cc7520d 26-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

{install|remove}_io_interrupt_handler() now correctly handle the B_NO_ENABLE_COUNTER flag.
Lots of cleanup:
- moved B_NO_ENABLE_COUNTER flag definition out of int.h to KernelExport.h, as it's
described in the BeBook (although it's probably not really used that often :))
- int.c no longer has any platform dependent code (+ 0x20 on interrupt numbers is gone);
it's now entirely handled in the arch/x86/ section.
- the io_vectors[] is now statically initialized, instead of allocated from the heap
- removed {install|remove}_interrupt_handler(); they weren't that useful, arch_smp_init()
is now calling install_io_interrupt_handler() correctly instead
- introduced a new arch_int.h header file that currently contains NUM_IO_VECTORS only
(though on x86, it also has ARCH_INTERRUPT_BASE == 0x20).
- changed the return type from {install|remove}_io_interrupt_handler() from "long" to
"status_t"
- rearranged and cleaned the PIC initialization code, made the PIC code more prominent
- changed comments that talk about a non existing 8239 (the PIC chip is actually 8259)
- moved arch/x86/interrupts.h to the source directory, as it's not used outside
- added BeOS compatible interrupts_enabled() function, that should replace our
equivalent (and private) are_interrupts_enabled()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12477 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f80b1fa5b588ca611fea1ab142dbaba6b9eaa733 12-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Moved the kernel_startup variable declaration from int.h to kernel.h (it's defined in main.c).
Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12327 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 74b043d98d35652a6892fc430537a02f5f9d9f76 17-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Removed execute property that was set accidently (since CVS days).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11896 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b0d8e689acb4ec1fbe798773cfb066277c7d4f9b 20-Oct-2004 Axel Dörfler <axeld@pinc-software.de>

Renamed some more init2 routines to init_post_vm() to make it clearer when
and why they are called.
Introduced a cpu_init_post_vm() that will now call arch_init_post_vm() instead
of letting main() doing it.
Fixed some return types (mostly from int to status_t).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9438 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 229ad83bf822e945bc4bf81979cead51463652ba 28-Oct-2003 Axel Dörfler <axeld@pinc-software.de>

Renamed arch_int_is_interrupts_enabled() to arch_int_are_interrupts_enabled().
Replaced definitions for enable_interrupts() and are_interrupts_enabled()
with static inlines.
Made int.h C++ safe.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5190 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 564cba312ebe49860fbb8416737c4de3e6ccd5f2 03-May-2003 Axel Dörfler <axeld@pinc-software.de>

Some header work: removed unnecessary dependencies to stage2.h, fixed
some broken C++ export definitions, added missing licenses etc.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3152 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7991b1a031c8c5cc4bdff658853743314c73056b 27-Nov-2002 beveloper <beveloper@nowhere.fake>

added a lot of debugging functions that should help fixing bugs


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2099 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5cdacbaabbd66673ada83b4d97d87126776484dc 26-Oct-2002 lillo <lillo@nowhere.fake>

*LOTS* of small changes to make the kernel compatible with Be's KernelExport.h


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1683 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ba192e3cf5a2bd40dcd48a0347d94d2cc4addb0 24-Jul-2002 David Reid <dreid@nowhere.fake>

Remove the int_ from in front of the enable/disable interrupt functions.

These will need to be reviewed as beos drivers expect them to be available
and using #define won't cover that.

The doxygen stuff doesn't all work though I can't figure out why :(


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@423 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c6aa053941ff404170bad5efc5450552afc744aa 19-Jul-2002 David Reid <dreid@nowhere.fake>

Add some new functions for the big change coming (again) for the
interrupt code. Also start adding doxygen comments :)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@347 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca91310a67a127973acf0b5a6d1fe890349c6de5 19-Jul-2002 David Reid <dreid@nowhere.fake>

Start the change to using beos style interrupt handlers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@336 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96