1 /* Copyright 2018 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
4 #include <metal/switch.h>
5 #include <metal/machine.h>
7 struct metal_switch* metal_switch_get (char *label)
10 struct metal_switch *flip;
12 if ((__METAL_DT_MAX_BUTTONS == 0) || (label == NULL)) {
16 for (i = 0; i < __METAL_DT_MAX_BUTTONS; i++) {
17 flip = (struct metal_switch*)__metal_switch_table[i];
18 if (flip->vtable->switch_exist(flip, label)) {
25 extern __inline__ struct metal_interrupt*
26 metal_switch_interrupt_controller(struct metal_switch *flip);
27 extern __inline__ int metal_switch_get_interrupt_id(struct metal_switch *flip);