2015-06-05 22:19:43 +08:00
|
|
|
/* offsets.c - nanokernel structure member offset definition file */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2010-2014 Wind River Systems, Inc.
|
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2015-04-11 07:44:37 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
DESCRIPTION
|
|
|
|
This module is responsible for the generation of the absolute symbols whose
|
|
|
|
value represents the member offsets for various IA-32 nanokernel structures.
|
|
|
|
|
|
|
|
All of the absolute symbols defined by this module will be present in the
|
|
|
|
final microkernel or nanokernel ELF image (due to the linker's reference to
|
|
|
|
the _OffsetAbsSyms symbol).
|
|
|
|
|
|
|
|
INTERNAL
|
|
|
|
It is NOT necessary to define the offset for every member of a structure.
|
|
|
|
Typically, only those members that are accessed by assembly language routines
|
|
|
|
are defined; however, it doesn't hurt to define all fields for the sake of
|
|
|
|
completeness.
|
|
|
|
|
2015-07-02 05:22:39 +08:00
|
|
|
*/
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-06-20 02:14:59 +08:00
|
|
|
#include <gen_offset.h> /* located in kernel/arch/common/include */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/* list of headers that define whose structure offsets will be generated */
|
|
|
|
|
2015-06-19 23:07:02 +08:00
|
|
|
#include <nano_private.h>
|
2015-04-11 07:44:37 +08:00
|
|
|
#include <swapstk.h>
|
|
|
|
|
|
|
|
|
2015-06-20 02:19:13 +08:00
|
|
|
#include <nano_offsets.h>
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/* Intel-specific tNANO structure member offsets */
|
|
|
|
|
|
|
|
GEN_OFFSET_SYM(tNANO, nested);
|
|
|
|
GEN_OFFSET_SYM(tNANO, common_isp);
|
|
|
|
#ifdef CONFIG_ADVANCED_POWER_MANAGEMENT
|
|
|
|
GEN_OFFSET_SYM(tNANO, idle);
|
|
|
|
#endif /* CONFIG_ADVANCED_POWER_MANAGEMENT */
|
|
|
|
|
2015-08-20 23:04:01 +08:00
|
|
|
/* Intel-specific struct tcs structure member offsets */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_GDB_INFO
|
2015-08-20 23:04:01 +08:00
|
|
|
GEN_OFFSET_SYM(tTCS, esfPtr);
|
2015-04-11 07:44:37 +08:00
|
|
|
#endif /* CONFIG_GDB_INFO */
|
|
|
|
#if (defined(CONFIG_FP_SHARING) || defined(CONFIG_GDB_INFO))
|
2015-08-20 23:04:01 +08:00
|
|
|
GEN_OFFSET_SYM(tTCS, excNestCount);
|
2015-04-11 07:44:37 +08:00
|
|
|
#endif /* CONFIG_FP_SHARING || CONFIG_GDB_INFO */
|
2015-08-20 23:04:01 +08:00
|
|
|
#ifdef CONFIG_THREAD_CUSTOM_DATA
|
|
|
|
GEN_OFFSET_SYM(tTCS, custom_data); /* available for custom use */
|
2015-04-11 07:44:37 +08:00
|
|
|
#endif
|
2015-08-20 23:04:01 +08:00
|
|
|
GEN_OFFSET_SYM(tTCS, coopFloatReg); /* start of coop FP register set */
|
|
|
|
GEN_OFFSET_SYM(tTCS, preempFloatReg); /* start of prempt FP register set */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-08-20 23:04:01 +08:00
|
|
|
/* size of the struct tcs structure sans save area for floating point regs */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-08-20 23:04:01 +08:00
|
|
|
GEN_ABSOLUTE_SYM(__tTCS_NOFLOAT_SIZEOF,
|
|
|
|
sizeof(tTCS) - sizeof(tCoopFloatReg) -
|
2015-04-11 07:44:37 +08:00
|
|
|
sizeof(tPreempFloatReg));
|
|
|
|
|
2015-08-20 23:04:01 +08:00
|
|
|
/* tCoopReg structure member offsets: tTCS->coopReg is of type tCoopReg */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
GEN_OFFSET_SYM(tCoopReg, esp);
|
|
|
|
|
|
|
|
/* tSwapStk structure member offsets */
|
|
|
|
|
|
|
|
GEN_OFFSET_SYM(tSwapStk, eax);
|
|
|
|
GEN_OFFSET_SYM(tSwapStk, ebp);
|
|
|
|
GEN_OFFSET_SYM(tSwapStk, ebx);
|
|
|
|
GEN_OFFSET_SYM(tSwapStk, esi);
|
|
|
|
GEN_OFFSET_SYM(tSwapStk, edi);
|
|
|
|
GEN_OFFSET_SYM(tSwapStk, retAddr);
|
|
|
|
GEN_OFFSET_SYM(tSwapStk, param);
|
|
|
|
|
|
|
|
/* size of the entire tSwapStk structure */
|
|
|
|
|
|
|
|
GEN_ABSOLUTE_SYM(__tSwapStk_SIZEOF, sizeof(tSwapStk));
|
|
|
|
|
|
|
|
/* NANO_ESF structure member offsets */
|
|
|
|
|
|
|
|
#ifdef CONFIG_GDB_INFO
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, ebp);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, ebx);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, esi);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, edi);
|
|
|
|
#endif /* CONFIG_GDB_INFO */
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, cr2);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, edx);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, ecx);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, eax);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, errorCode);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, eip);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, cs);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, eflags);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, esp);
|
|
|
|
GEN_OFFSET_SYM(NANO_ESF, ss);
|
|
|
|
|
|
|
|
/* tTaskStateSegment structure member offsets */
|
|
|
|
|
|
|
|
|
|
|
|
/* size of the ISR_LIST structure. Used by linker scripts */
|
|
|
|
|
|
|
|
GEN_ABSOLUTE_SYM(__ISR_LIST_SIZEOF, sizeof(ISR_LIST));
|
|
|
|
|
|
|
|
|
|
|
|
GEN_ABS_SYM_END
|