878a0f050e
Rename _DEVICE_STRUCT_SIZE to _DEVICE_STRUCT_SIZEOF. This causes it to be picked by the script 'gen_offset_header.py' and inserted into the header file 'include/generated/offsets.h'. Renaming from x_SIZE to x_SIZEOF will align it's name with the other symbols that denote a sctruct's size, like K_THREAD_SIZEOF. Furthermore, it will allow the symbol to be accessed through a header file define, instead of only as an extern symbol. This is more flexible, and more aligned with the other symbols in offsets. Finally, if we are able to move all of offsets.c symbols into the offsets.h header file we be able to remove offsets.o from the link and thereby simplify the linking process. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
84 lines
2 KiB
C
84 lines
2 KiB
C
/*
|
|
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#include <device.h>
|
|
|
|
#ifndef ZEPHYR_KERNEL_INCLUDE_KERNEL_OFFSETS_H_
|
|
#define ZEPHYR_KERNEL_INCLUDE_KERNEL_OFFSETS_H_
|
|
|
|
#include <syscall_list.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)
|
|
|
|
#ifndef CONFIG_SMP
|
|
GEN_OFFSET_SYM(_kernel_t, current);
|
|
GEN_OFFSET_SYM(_kernel_t, nested);
|
|
GEN_OFFSET_SYM(_kernel_t, irq_stack);
|
|
#endif
|
|
|
|
GEN_OFFSET_SYM(_cpu_t, current);
|
|
GEN_OFFSET_SYM(_cpu_t, nested);
|
|
GEN_OFFSET_SYM(_cpu_t, irq_stack);
|
|
|
|
#if defined(CONFIG_THREAD_MONITOR)
|
|
GEN_OFFSET_SYM(_kernel_t, threads);
|
|
#endif
|
|
|
|
#ifdef CONFIG_SYS_POWER_MANAGEMENT
|
|
GEN_OFFSET_SYM(_kernel_t, idle);
|
|
#endif
|
|
|
|
GEN_OFFSET_SYM(_kernel_t, ready_q);
|
|
GEN_OFFSET_SYM(_kernel_t, arch);
|
|
|
|
#ifndef CONFIG_SMP
|
|
GEN_OFFSET_SYM(_ready_q_t, cache);
|
|
#endif
|
|
|
|
#ifdef CONFIG_FP_SHARING
|
|
GEN_OFFSET_SYM(_kernel_t, current_fp);
|
|
#endif
|
|
|
|
GEN_ABSOLUTE_SYM(_STRUCT_KERNEL_SIZE, sizeof(struct _kernel));
|
|
|
|
GEN_OFFSET_SYM(_thread_base_t, user_options);
|
|
GEN_OFFSET_SYM(_thread_base_t, thread_state);
|
|
GEN_OFFSET_SYM(_thread_base_t, prio);
|
|
GEN_OFFSET_SYM(_thread_base_t, sched_locked);
|
|
GEN_OFFSET_SYM(_thread_base_t, preempt);
|
|
GEN_OFFSET_SYM(_thread_base_t, swap_data);
|
|
|
|
GEN_OFFSET_SYM(_thread_t, base);
|
|
GEN_OFFSET_SYM(_thread_t, caller_saved);
|
|
GEN_OFFSET_SYM(_thread_t, callee_saved);
|
|
GEN_OFFSET_SYM(_thread_t, arch);
|
|
|
|
#ifdef CONFIG_THREAD_STACK_INFO
|
|
GEN_OFFSET_SYM(_thread_stack_info_t, start);
|
|
GEN_OFFSET_SYM(_thread_stack_info_t, size);
|
|
|
|
GEN_OFFSET_SYM(_thread_t, stack_info);
|
|
#endif
|
|
|
|
#if defined(CONFIG_THREAD_MONITOR)
|
|
GEN_OFFSET_SYM(_thread_t, next_thread);
|
|
#endif
|
|
|
|
#ifdef CONFIG_THREAD_CUSTOM_DATA
|
|
GEN_OFFSET_SYM(_thread_t, custom_data);
|
|
#endif
|
|
|
|
GEN_ABSOLUTE_SYM(K_THREAD_SIZEOF, sizeof(struct k_thread));
|
|
|
|
/* size of the device structure. Used by linker scripts */
|
|
GEN_ABSOLUTE_SYM(_DEVICE_STRUCT_SIZEOF, sizeof(struct device));
|
|
|
|
#endif /* ZEPHYR_KERNEL_INCLUDE_KERNEL_OFFSETS_H_ */
|