1 /*
2  * Copyright 2023 The ChromiumOS Authors
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <../soc/ite/ec/common/chip_chipregs.h>
8 
9 /*
10  * Macros for emulated hardware registers access.
11  */
12 #undef ECREG
13 #undef ECREG_u16
14 #undef ECREG_u32
15 #define ECREG(x)		(*((volatile unsigned char *)fake_ecreg((intptr_t)x)))
16 #define ECREG_u16(x)		(*((volatile unsigned short *)fake_ecreg((intptr_t)x)))
17 #define ECREG_u32(x)		(*((volatile unsigned long  *)fake_ecreg((intptr_t)x)))
18 
19 unsigned int *fake_ecreg(intptr_t r);
20 uint8_t ite_intc_get_irq_num(void);
21