2017-01-19 05:46:13 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Wind River Systems, Inc.
|
|
|
|
* Copyright (c) 2016 Cadence Design Systems, Inc.
|
2017-01-25 07:10:39 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2017-01-19 05:46:13 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Private kernel definitions (XTENSA)
|
|
|
|
*
|
|
|
|
* This file contains private kernel structures definitions and various
|
|
|
|
* other definitions for the XTENSA processors family 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _kernel_arch_data__h_
|
|
|
|
#define _kernel_arch_data__h_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <toolchain.h>
|
2017-06-17 23:30:47 +08:00
|
|
|
#include <linker/sections.h>
|
2017-01-19 05:46:13 +08:00
|
|
|
#include <arch/cpu.h>
|
2017-04-05 04:19:13 +08:00
|
|
|
#include <kernel_arch_thread.h>
|
2017-01-19 05:46:13 +08:00
|
|
|
|
|
|
|
#if !defined(_ASMLANGUAGE) && !defined(__ASSEMBLER__)
|
|
|
|
#include <kernel.h> /* public kernel API */
|
2018-01-31 12:41:47 +08:00
|
|
|
#include <kernel_internal.h>
|
Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t. This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.
We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.
We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.
Jira: ZEP-2051
Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-19 23:32:08 +08:00
|
|
|
#include <zephyr/types.h>
|
2017-01-19 05:46:13 +08:00
|
|
|
#include <misc/dlist.h>
|
|
|
|
#include <misc/util.h>
|
|
|
|
|
|
|
|
/* Bitmask definitions for the struct k_thread->flags bit field */
|
|
|
|
|
|
|
|
/* executing context is interrupt handler */
|
|
|
|
#define INT_ACTIVE (1 << 1)
|
|
|
|
/* executing context is exception handler */
|
|
|
|
#define EXC_ACTIVE (1 << 2)
|
|
|
|
/* thread uses floating point unit */
|
|
|
|
#define USE_FP 0x010
|
|
|
|
|
|
|
|
typedef struct __esf __esf_t;
|
|
|
|
|
|
|
|
struct _kernel_arch {
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _kernel_arch _kernel_arch_t;
|
|
|
|
|
|
|
|
#endif /*! _ASMLANGUAGE && ! __ASSEMBLER__ */
|
|
|
|
|
2017-12-10 00:37:20 +08:00
|
|
|
#ifdef CONFIG_USE_SWITCH
|
|
|
|
void xtensa_switch(void *switch_to, void **switched_from);
|
|
|
|
#define _arch_switch xtensa_switch
|
|
|
|
#endif
|
2017-01-19 05:46:13 +08:00
|
|
|
|
|
|
|
/* stacks */
|
|
|
|
#define STACK_ROUND_UP(x) ROUND_UP(x, STACK_ALIGN_SIZE)
|
|
|
|
#define STACK_ROUND_DOWN(x) ROUND_DOWN(x, STACK_ALIGN_SIZE)
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _kernel_arch_data__h_ */
|
|
|
|
|