source: rtems/bsps/shared/irq/irq-info.c @ 9b7c456

5
Last change on this file since 9b7c456 was 9b7c456, checked in by Sebastian Huber <sebastian.huber@…>, on 04/05/18 at 04:40:02

bsps: Move generic IRQ support to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[51a6fd5]1/**
2 * @file
3 *
4 * @ingroup bsp_interrupt
5 *
[8634637]6 * @brief Generic BSP interrupt information implementation.
[51a6fd5]7 */
8
9/*
[11d6263b]10 * Copyright (c) 2008, 2009, 2010
[8634637]11 * embedded brains GmbH
[51a6fd5]12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
[8634637]15 * <rtems@embedded-brains.de>
[51a6fd5]16 *
[8634637]17 * The license and distribution terms for this file may be
18 * found in the file LICENSE in this distribution or at
[c499856]19 * http://www.rtems.org/license/LICENSE.
[51a6fd5]20 */
21
22#include <inttypes.h>
23
[506bfc8]24#include <rtems/printer.h>
[24d0ee57]25
[51a6fd5]26#include <bsp/irq-generic.h>
27#include <bsp/irq-info.h>
28
29typedef struct {
[24d0ee57]30  const rtems_printer *printer;
[8634637]31  rtems_vector_number vector;
[51a6fd5]32} bsp_interrupt_report_entry;
33
34static void bsp_interrupt_report_per_handler_routine(
[8634637]35  void *arg,
36  const char *info,
37  rtems_option options,
38  rtems_interrupt_handler handler,
39  void *handler_arg
[51a6fd5]40)
41{
[8634637]42  bsp_interrupt_report_entry *e = (bsp_interrupt_report_entry *) arg;
43  const char *opt = options == RTEMS_INTERRUPT_UNIQUE ? "UNIQUE" : "SHARED";
[51a6fd5]44
[24d0ee57]45  rtems_printf(
46    e->printer,
47    "%7" PRIu32 " | %-32s | %7s | %p | %p\n",
[8634637]48    e->vector,
49    info,
50    opt,
51    handler,
52    handler_arg
53  );
[51a6fd5]54}
55
[8634637]56void bsp_interrupt_report_with_plugin(
[24d0ee57]57  const rtems_printer *printer
[8634637]58)
[51a6fd5]59{
[8634637]60  rtems_vector_number v = 0;
61  bsp_interrupt_report_entry e = {
[24d0ee57]62    .printer = printer,
[8634637]63    .vector = 0
64  };
[51a6fd5]65
[24d0ee57]66  rtems_printf(
67    printer,
[8634637]68    "-------------------------------------------------------------------------------\n"
69    "                             INTERRUPT INFORMATION\n"
70    "--------+----------------------------------+---------+------------+------------\n"
71    " VECTOR | INFO                             | OPTIONS | HANDLER    | ARGUMENT   \n"
72    "--------+----------------------------------+---------+------------+------------\n"
73  );
[51a6fd5]74
[8634637]75  for (v = BSP_INTERRUPT_VECTOR_MIN; v <= BSP_INTERRUPT_VECTOR_MAX; ++v) {
76    e.vector = v;
77    rtems_interrupt_handler_iterate(
78      v,
79      bsp_interrupt_report_per_handler_routine,
80      &e
81    );
82  }
[51a6fd5]83
[24d0ee57]84  rtems_printf(
85    printer,
[8634637]86    "--------+----------------------------------+---------+------------+------------\n"
87  );
[51a6fd5]88}
89
[8634637]90void bsp_interrupt_report(void)
[51a6fd5]91{
[24d0ee57]92  rtems_printer printer;
93  rtems_print_printer_printk(&printer);
94  bsp_interrupt_report_with_plugin(&printer);
[51a6fd5]95}
Note: See TracBrowser for help on using the repository browser.