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 Apr 5, 2018 at 4:40:02 AM

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