blob: 3f5ff45fc80919133ca3a93ddd583aa612877802 [file] [log] [blame]
Alexei Fedorov2f13d6c2020-02-21 10:17:26 +00001/*
2 * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <stdint.h>
8
9#include "gicv3_private.h"
10
11/*******************************************************************************
12 * GIC Distributor interface accessors for bit operations
13 ******************************************************************************/
14
15/*
16 * Accessor to read the GIC Distributor IGRPMODR corresponding to the
17 * interrupt `id`, 32 interrupt IDs at a time.
18 */
19uint32_t gicd_read_igrpmodr(uintptr_t base, unsigned int id)
20{
21 return GICD_READ(IGRPMODR, base, id);
22}
23
24/*
25 * Accessor to write the GIC Distributor IGRPMODR corresponding to the
26 * interrupt `id`, 32 interrupt IDs at a time.
27 */
28void gicd_write_igrpmodr(uintptr_t base, unsigned int id, uint32_t val)
29{
30 GICD_WRITE(IGRPMODR, base, id, val);
31}
32
33/*
34 * Accessor to get the bit corresponding to interrupt ID
35 * in GIC Distributor IGRPMODR.
36 */
37unsigned int gicd_get_igrpmodr(uintptr_t base, unsigned int id)
38{
39 return GICD_GET_BIT(IGRPMODR, base, id);
40}
41
42/*
43 * Accessor to set the bit corresponding to interrupt ID
44 * in GIC Distributor IGRPMODR.
45 */
46void gicd_set_igrpmodr(uintptr_t base, unsigned int id)
47{
48 GICD_SET_BIT(IGRPMODR, base, id);
49}
50
51/*
52 * Accessor to clear the bit corresponding to interrupt ID
53 * in GIC Distributor IGRPMODR.
54 */
55void gicd_clr_igrpmodr(uintptr_t base, unsigned int id)
56{
57 GICD_CLR_BIT(IGRPMODR, base, id);
58}