Skip to content
Permalink
Browse files

arch/x86: refactor offsets_short_arch.h

The current version is 32-bit specific, so move it to ia32/
and add a layer of indirection via an arch-level header file.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
  • Loading branch information...
Charles E. Youse authored and nashif committed Jun 29, 2019
1 parent 820ea28 commit e96c178e93e87cdc23f328b479c1782c3538df4e
Showing with 36 additions and 23 deletions.
  1. +32 −0 arch/x86/include/ia32/offsets_short_arch.h
  2. +4 −23 arch/x86/include/offsets_short_arch.h
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2016 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_ARCH_X86_INCLUDE_IA32_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_X86_INCLUDE_IA32_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>

/* kernel */

#define _kernel_offset_to_isf \
(___kernel_t_arch_OFFSET + ___kernel_arch_t_isf_OFFSET)

/* end - kernel */

/* threads */

#define _thread_offset_to_excNestCount \
(___thread_t_arch_OFFSET + ___thread_arch_t_excNestCount_OFFSET)

#define _thread_offset_to_esp \
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_esp_OFFSET)

#define _thread_offset_to_preempFloatReg \
(___thread_t_arch_OFFSET + ___thread_arch_t_preempFloatReg_OFFSET)

/* end - threads */

#endif /* ZEPHYR_ARCH_X86_INCLUDE_IA32_OFFSETS_SHORT_ARCH_H_ */
@@ -1,32 +1,13 @@
/*
* Copyright (c) 2016 Wind River Systems, Inc.
*
* Copyright (c) 2019 Intel Corporation
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_ARCH_X86_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_X86_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>

/* kernel */

#define _kernel_offset_to_isf \
(___kernel_t_arch_OFFSET + ___kernel_arch_t_isf_OFFSET)

/* end - kernel */

/* threads */

#define _thread_offset_to_excNestCount \
(___thread_t_arch_OFFSET + ___thread_arch_t_excNestCount_OFFSET)

#define _thread_offset_to_esp \
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_esp_OFFSET)

#define _thread_offset_to_preempFloatReg \
(___thread_t_arch_OFFSET + ___thread_arch_t_preempFloatReg_OFFSET)

/* end - threads */
#ifndef CONFIG_X86_LONGMODE
#include <ia32/offsets_short_arch.h>
#endif

#endif /* ZEPHYR_ARCH_X86_INCLUDE_OFFSETS_SHORT_ARCH_H_ */

0 comments on commit e96c178

Please sign in to comment.
You can’t perform that action at this time.