2016-11-08 23:36:50 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-11-08 23:36:50 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Private kernel definitions
|
|
|
|
*
|
|
|
|
* This file contains private kernel function/macro definitions and various
|
|
|
|
* other definitions for the Nios II processor architecture.
|
|
|
|
*
|
|
|
|
* This file is also included by assembly language files which must #define
|
|
|
|
* _ASMLANGUAGE before including this header file. Note that kernel
|
|
|
|
* assembly source files obtains structure offset values via "absolute
|
|
|
|
* symbols" in the offsets.o module.
|
|
|
|
*/
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#ifndef ZEPHYR_ARCH_NIOS2_INCLUDE_KERNEL_ARCH_FUNC_H_
|
|
|
|
#define ZEPHYR_ARCH_NIOS2_INCLUDE_KERNEL_ARCH_FUNC_H_
|
2016-11-08 23:36:50 +08:00
|
|
|
|
2019-10-24 23:08:21 +08:00
|
|
|
#include <kernel_arch_data.h>
|
|
|
|
|
2016-11-08 23:36:50 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
|
2019-11-08 04:43:29 +08:00
|
|
|
static ALWAYS_INLINE void arch_kernel_init(void)
|
2016-11-08 23:36:50 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static ALWAYS_INLINE void
|
2019-11-08 04:43:29 +08:00
|
|
|
arch_thread_return_value_set(struct k_thread *thread, unsigned int value)
|
2016-11-08 23:36:50 +08:00
|
|
|
{
|
|
|
|
thread->callee_saved.retval = value;
|
|
|
|
}
|
|
|
|
|
2019-07-12 05:18:28 +08:00
|
|
|
FUNC_NORETURN void z_nios2_fatal_error(unsigned int reason,
|
2019-07-17 06:21:19 +08:00
|
|
|
const z_arch_esf_t *esf);
|
2019-07-12 05:18:28 +08:00
|
|
|
|
2019-11-08 04:43:29 +08:00
|
|
|
static inline bool arch_is_in_isr(void)
|
2019-10-04 05:32:22 +08:00
|
|
|
{
|
2020-03-17 01:18:03 +08:00
|
|
|
return _kernel.cpus[0].nested != 0U;
|
2019-10-04 05:32:22 +08:00
|
|
|
}
|
2016-11-08 23:36:50 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_IRQ_OFFLOAD
|
2019-03-14 23:20:46 +08:00
|
|
|
void z_irq_do_offload(void);
|
2016-11-08 23:36:50 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ALT_CPU_ICACHE_SIZE > 0
|
2019-03-14 23:20:46 +08:00
|
|
|
void z_nios2_icache_flush_all(void);
|
2016-11-08 23:36:50 +08:00
|
|
|
#else
|
2019-03-14 23:20:46 +08:00
|
|
|
#define z_nios2_icache_flush_all() do { } while (0)
|
2016-11-08 23:36:50 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if ALT_CPU_DCACHE_SIZE > 0
|
2019-03-14 23:20:46 +08:00
|
|
|
void z_nios2_dcache_flush_all(void);
|
2020-05-28 00:26:57 +08:00
|
|
|
void z_nios2_dcache_flush_no_writeback(void *start, uint32_t len);
|
2016-11-08 23:36:50 +08:00
|
|
|
#else
|
2019-03-14 23:20:46 +08:00
|
|
|
#define z_nios2_dcache_flush_all() do { } while (0)
|
|
|
|
#define z_nios2_dcache_flush_no_writeback(x, y) do { } while (0)
|
2016-11-08 23:36:50 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#endif /* ZEPHYR_ARCH_NIOS2_INCLUDE_KERNEL_ARCH_FUNC_H_ */
|