03ce34cf8f
Add Kconfig symbol, asm/mtd-xip.h header and define related macros: xip_cpu_idle, xip_irqpending, xip_currtime and xip_elapsed_since. Append .xiptext to the vectors when separate vectors are configured because otherwise they are appended to the data and data may not even be executable in XIP configuration. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
15 lines
441 B
C
15 lines
441 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#ifndef _ASM_MTD_XIP_H
|
|
#define _ASM_MTD_XIP_H
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#define xip_irqpending() (xtensa_get_sr(interrupt) & xtensa_get_sr(intenable))
|
|
#define xip_currtime() (xtensa_get_sr(ccount))
|
|
#define xip_elapsed_since(x) ((xtensa_get_sr(ccount) - (x)) / 1000) /* should work up to 1GHz */
|
|
#define xip_cpu_idle() do { asm volatile ("waiti 0"); } while (0)
|
|
|
|
#endif /* _ASM_MTD_XIP_H */
|
|
|