Skip to content

Commit

Permalink
core: interrupt: remove old API functions
Browse files Browse the repository at this point in the history
Remove old itr_xxx() API functions.

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
  • Loading branch information
etienne-lms committed Oct 17, 2023
1 parent 08c2d86 commit ef4120a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 100 deletions.
34 changes: 0 additions & 34 deletions core/include/kernel/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,47 +158,13 @@ static inline int dt_get_irq(const void *fdt, int node)
}
#endif

struct itr_handler *itr_alloc_add_type_prio(size_t it, itr_handler_t handler,
uint32_t flags, void *data,
uint32_t type, uint32_t prio);
void itr_free(struct itr_handler *hdl);
void itr_add_type_prio(struct itr_handler *handler, uint32_t type,
uint32_t prio);
void itr_enable(size_t it);
void itr_disable(size_t it);
/* raise the Peripheral Interrupt corresponding to the interrupt ID */
void itr_raise_pi(size_t it);
/*
* raise the Software Generated Interrupt corresponding to the interrupt ID,
* the cpu_mask represents which cpu interface to forward.
*/
void itr_raise_sgi(size_t it, uint8_t cpu_mask);
/*
* let corresponding interrupt forward to the cpu interface
* according to the cpu_mask.
*/
void itr_set_affinity(size_t it, uint8_t cpu_mask);

/*
* __weak overridable function which is called when a secure interrupt is
* received. The default function calls panic() immediately, platforms which
* expects to receive secure interrupts should override this function.
*/
void interrupt_main_handler(void);

static inline void itr_add(struct itr_handler *handler)
{
itr_add_type_prio(handler, IRQ_TYPE_NONE, 0);
}

static inline struct itr_handler *itr_alloc_add(size_t it,
itr_handler_t handler,
uint32_t flags, void *data)
{
return itr_alloc_add_type_prio(it, handler, flags, data, IRQ_TYPE_NONE,
0);
}

/*
* Interrupt controller chip API functions
*/
Expand Down
66 changes: 0 additions & 66 deletions core/kernel/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,72 +65,6 @@ int dt_get_irq_type_prio(const void *fdt, int node, uint32_t *type,
}
#endif

struct itr_handler *itr_alloc_add_type_prio(size_t it, itr_handler_t handler,
uint32_t flags, void *data,
uint32_t type, uint32_t prio)
{
struct itr_handler *hdl = calloc(1, sizeof(*hdl));

if (hdl) {
hdl->it = it;
hdl->handler = handler;
hdl->flags = flags;
hdl->data = data;
itr_add_type_prio(hdl, type, prio);
}

return hdl;
}

void itr_free(struct itr_handler *hdl)
{
if (!hdl)
return;

itr_main_chip->ops->disable(itr_main_chip, hdl->it);

SLIST_REMOVE(&itr_main_chip->handlers, hdl, itr_handler, link);
free(hdl);
}

void itr_add_type_prio(struct itr_handler *h, uint32_t type, uint32_t prio)
{
struct itr_handler __maybe_unused *hdl = NULL;

SLIST_FOREACH(hdl, &itr_main_chip->handlers, link)
if (hdl->it == h->it)
assert((hdl->flags & ITRF_SHARED) &&
(h->flags & ITRF_SHARED));

itr_main_chip->ops->add(itr_main_chip, h->it, type, prio);
SLIST_INSERT_HEAD(&itr_main_chip->handlers, h, link);
}

void itr_enable(size_t it)
{
itr_main_chip->ops->enable(itr_main_chip, it);
}

void itr_disable(size_t it)
{
itr_main_chip->ops->disable(itr_main_chip, it);
}

void itr_raise_pi(size_t it)
{
itr_main_chip->ops->raise_pi(itr_main_chip, it);
}

void itr_raise_sgi(size_t it, uint8_t cpu_mask)
{
itr_main_chip->ops->raise_sgi(itr_main_chip, it, cpu_mask);
}

void itr_set_affinity(size_t it, uint8_t cpu_mask)
{
itr_main_chip->ops->set_affinity(itr_main_chip, it, cpu_mask);
}

/* This function is supposed to be overridden in platform specific code */
void __weak __noreturn interrupt_main_handler(void)
{
Expand Down

0 comments on commit ef4120a

Please sign in to comment.