zephyr/kernel/nanokernel/include/nano_offsets.h
Andrew Boie 68b3b6135e errno: implement _get_errno() in common code
We really should have more faith in the compiler, it generates
code to implement this exactly like the arch-specific assembly
versions, and on ARM is actually 4 bytes shorter.

FUNC_NO_FP used to disable the usual C preamble to update the
frame/stack pointers, which is how the sizes are still the same
or less. It's debatable how useful the occasional use of
FUNC_NO_FP is in practice since it hinders debugging and in a
production build frame pointers should be globally disabled, but
we can address that later.

Change-Id: I6c4b64ab3e3a9b6f91d52fa8c92e6e79a986fc77
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-04 17:04:14 +00:00

68 lines
1.9 KiB
C

/* nano_offsets.h - nanokernel structure member offset definitions */
/*
* Copyright (c) 2013-2014 Wind River Systems, Inc.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#include <device.h>
#ifndef _NANO_OFFSETS__H_
#define _NANO_OFFSETS__H_
/*
* The final link step uses the symbol _OffsetAbsSyms to force the linkage of
* offsets.o into the ELF image.
*/
GEN_ABS_SYM_BEGIN(_OffsetAbsSyms)
/* arch-agnostic tNANO structure member offsets */
GEN_OFFSET_SYM(tNANO, fiber);
GEN_OFFSET_SYM(tNANO, task);
GEN_OFFSET_SYM(tNANO, current);
#if defined(CONFIG_THREAD_MONITOR)
GEN_OFFSET_SYM(tNANO, threads);
#endif
#ifdef CONFIG_FP_SHARING
GEN_OFFSET_SYM(tNANO, current_fp);
#endif
/* size of the entire tNANO structure */
GEN_ABSOLUTE_SYM(__tNANO_SIZEOF, sizeof(tNANO));
/* arch-agnostic struct tcs structure member offsets */
GEN_OFFSET_SYM(tTCS, link);
GEN_OFFSET_SYM(tTCS, prio);
GEN_OFFSET_SYM(tTCS, flags);
GEN_OFFSET_SYM(tTCS, coopReg); /* start of coop register set */
GEN_OFFSET_SYM(tTCS, preempReg); /* start of prempt register set */
#if defined(CONFIG_THREAD_MONITOR)
GEN_OFFSET_SYM(tTCS, next_thread);
#endif
/* size of the entire struct tcs structure */
GEN_ABSOLUTE_SYM(__tTCS_SIZEOF, sizeof(tTCS));
/* size of the device structure. Used by linker scripts */
GEN_ABSOLUTE_SYM(__DEVICE_STR_SIZEOF, sizeof(struct device));
#endif /* _NANO_OFFSETS__H_ */