From b0c83f328c2bc62c1bade3e77da083a00ce36102 Mon Sep 17 00:00:00 2001 From: Radoslaw Koppel Date: Wed, 31 Jan 2024 22:50:24 +0100 Subject: [PATCH] arch: sw_isr_table: Update shared interrupts structures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the definition of z_shared_isr_table_entry to use _isr_table_entry instead of specially created z_shared_isr_client. Signed-off-by: Radosław Koppel --- arch/common/shared_irq.c | 12 ++++++------ doc/kernel/services/interrupts.rst | 11 +---------- include/zephyr/sw_isr_table.h | 7 +------ tests/kernel/interrupt/src/test_shared_irq.h | 2 +- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/arch/common/shared_irq.c b/arch/common/shared_irq.c index 68641cb2bb0..a05e78002ce 100644 --- a/arch/common/shared_irq.c +++ b/arch/common/shared_irq.c @@ -20,7 +20,7 @@ void z_shared_isr(const void *data) { size_t i; const struct z_shared_isr_table_entry *entry; - const struct z_shared_isr_client *client; + const struct _isr_table_entry *client; entry = data; @@ -42,7 +42,7 @@ void z_isr_install(unsigned int irq, void (*routine)(const void *), { struct z_shared_isr_table_entry *shared_entry; struct _isr_table_entry *entry; - struct z_shared_isr_client *client; + struct _isr_table_entry *client; unsigned int table_idx; int i; k_spinlock_key_t key; @@ -103,10 +103,10 @@ void z_isr_install(unsigned int irq, void (*routine)(const void *), k_spin_unlock(&lock, key); } -static void swap_client_data(struct z_shared_isr_client *a, - struct z_shared_isr_client *b) +static void swap_client_data(struct _isr_table_entry *a, + struct _isr_table_entry *b) { - struct z_shared_isr_client tmp; + struct _isr_table_entry tmp; tmp.arg = a->arg; tmp.isr = a->isr; @@ -162,7 +162,7 @@ int z_isr_uninstall(unsigned int irq, { struct z_shared_isr_table_entry *shared_entry; struct _isr_table_entry *entry; - struct z_shared_isr_client *client; + struct _isr_table_entry *client; unsigned int table_idx; size_t i; k_spinlock_key_t key; diff --git a/doc/kernel/services/interrupts.rst b/doc/kernel/services/interrupts.rst index b1f7421ed01..05e4809e568 100644 --- a/doc/kernel/services/interrupts.rst +++ b/doc/kernel/services/interrupts.rst @@ -549,7 +549,7 @@ This is an array of struct z_shared_isr_table_entry: .. code-block:: c struct z_shared_isr_table_entry { - struct z_shared_isr_client clients[CONFIG_SHARED_IRQ_MAX_NUM_CLIENTS]; + struct _isr_table_entry clients[CONFIG_SHARED_IRQ_MAX_NUM_CLIENTS]; size_t client_num; }; @@ -558,15 +558,6 @@ lines. Whenever an interrupt line becomes shared, :c:func:`z_shared_isr` will replace the currently registered ISR in _sw_isr_table. This special ISR will iterate through the list of registered clients and invoke the ISRs. -The definition for struct z_shared_isr_client is as follows: - -.. code-block:: c - - struct z_shared_isr_client { - void (*isr)(const void *arg); - const void *arg; - }; - x86 Details ----------- diff --git a/include/zephyr/sw_isr_table.h b/include/zephyr/sw_isr_table.h index f43efafad49..fc094b887ba 100644 --- a/include/zephyr/sw_isr_table.h +++ b/include/zephyr/sw_isr_table.h @@ -69,13 +69,8 @@ struct _isr_list { }; #ifdef CONFIG_SHARED_INTERRUPTS -struct z_shared_isr_client { - void (*isr)(const void *arg); - const void *arg; -}; - struct z_shared_isr_table_entry { - struct z_shared_isr_client clients[CONFIG_SHARED_IRQ_MAX_NUM_CLIENTS]; + struct _isr_table_entry clients[CONFIG_SHARED_IRQ_MAX_NUM_CLIENTS]; size_t client_num; }; diff --git a/tests/kernel/interrupt/src/test_shared_irq.h b/tests/kernel/interrupt/src/test_shared_irq.h index fd3c4c4a624..5ddd50a16e1 100644 --- a/tests/kernel/interrupt/src/test_shared_irq.h +++ b/tests/kernel/interrupt/src/test_shared_irq.h @@ -41,7 +41,7 @@ static inline bool client_exists_at_index(void (*routine)(const void *arg), { size_t i; struct z_shared_isr_table_entry *shared_entry; - struct z_shared_isr_client *client; + struct _isr_table_entry *client; shared_entry = &z_shared_sw_isr_table[irq];