2015-04-11 07:44:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014 Wind River Systems, Inc.
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2015-04-11 07:44:37 +08:00
|
|
|
*/
|
|
|
|
|
2015-12-04 23:09:39 +08:00
|
|
|
/**
|
|
|
|
* @file
|
2016-12-18 22:42:55 +08:00
|
|
|
* @brief ARCv2 kernel structure member offset definition file
|
2015-12-04 23:09:39 +08:00
|
|
|
*
|
2015-10-21 00:42:33 +08:00
|
|
|
* This module is responsible for the generation of the absolute symbols whose
|
2016-12-18 22:42:55 +08:00
|
|
|
* value represents the member offsets for various ARCv2 kernel structures.
|
2015-10-21 00:42:33 +08:00
|
|
|
*
|
|
|
|
* All of the absolute symbols defined by this module will be present in the
|
2016-12-18 22:42:55 +08:00
|
|
|
* final kernel ELF image (due to the linker's reference to the _OffsetAbsSyms
|
|
|
|
* symbol).
|
2015-10-21 00:42:33 +08:00
|
|
|
*
|
|
|
|
* 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>
|
2016-11-08 23:36:50 +08:00
|
|
|
#include <kernel_structs.h>
|
|
|
|
#include <kernel_offsets.h>
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_OFFSET_SYM(_thread_arch_t, intlock_key);
|
|
|
|
GEN_OFFSET_SYM(_thread_arch_t, relinquish_cause);
|
|
|
|
GEN_OFFSET_SYM(_thread_arch_t, return_value);
|
2016-03-12 01:29:14 +08:00
|
|
|
#ifdef CONFIG_ARC_STACK_CHECKING
|
2017-05-12 06:33:16 +08:00
|
|
|
GEN_OFFSET_SYM(_thread_arch_t, stack_base);
|
2016-03-12 01:29:14 +08:00
|
|
|
#endif
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/* ARCv2-specific IRQ stack frame structure member offsets */
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_OFFSET_SYM(_isf_t, r0);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r1);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r2);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r3);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r4);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r5);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r6);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r7);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r8);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r9);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r10);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r11);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r12);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, r13);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, blink);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, lp_end);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, lp_start);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, lp_count);
|
boards: Update arc em_starterkit support from 2.2 to 2.3
Here are the main changes:
* board: Update EMSK onboard resources such as Button, Switch and LEDs
+ update soc.h for em7d, em9d, em11d
+ update board.h for em_starterkit board
* arc: Add floating point support and code density support
+ add kconfig configuration
+ add compiler options
+ add register definitions, marcos, assembly codes
+ fixes in existing codes and configurations.
* arc: Update detailed board configurations for cores of emsk 2.3
* script: Provide arc_debugger.sh for debugging em_starterkit board
+ make BOARD=em_starterkit debug
This will start openocd server for emsk, and arc gdb will connect
to this debug server, user can run `continue` command if user just
want to run the application, or other commands if debugging needed.
+ make BOARD=em_starterkit debugserver
This will start an openocd debugger server for emsk, and user can
connect to this debugserver using arc gdb and do what they want to.
+ make BOARD=em_starterkit flash
This will download the zephyr application elf file to emsk,
and run it.
Signed-off-by: Huaqi Fang <huaqi.fang@synopsys.com>
2017-05-17 15:18:51 +08:00
|
|
|
#ifdef CONFIG_CODE_DENSITY
|
|
|
|
GEN_OFFSET_SYM(_isf_t, ei_base);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, ldi_base);
|
|
|
|
GEN_OFFSET_SYM(_isf_t, jli_base);
|
|
|
|
#endif
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_OFFSET_SYM(_isf_t, pc);
|
2018-05-23 16:27:26 +08:00
|
|
|
#ifdef CONFIG_ARC_HAS_SECURE
|
|
|
|
GEN_OFFSET_SYM(_isf_t, sec_stat);
|
|
|
|
#endif
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_OFFSET_SYM(_isf_t, status32);
|
|
|
|
GEN_ABSOLUTE_SYM(___isf_t_SIZEOF, sizeof(_isf_t));
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_OFFSET_SYM(_callee_saved_t, sp);
|
|
|
|
GEN_ABSOLUTE_SYM(___callee_saved_t_SIZEOF, sizeof(_callee_saved_t));
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r13);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r14);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r15);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r16);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r17);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r18);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r19);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r20);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r21);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r22);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r23);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r24);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r25);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r26);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, fp);
|
arch: arc: add user space support for arc
* add the implementation of syscall
* based on 'trap_s' intruction, id = 3
* add the privilege stack
* the privilege stack is allocted with thread stack
* for the kernel thread, the privilege stack is also a
part of thread stack, the start of stack can be configured
as stack guard
* for the user thread, no stack guard, when the user stack is
overflow, it will fall into kernel memory area which requires
kernel privilege, privilege violation will be raised
* modify the linker template and add MPU_ADDR_ALIGN
* add user space corresponding codes in mpu
* the user sp aux reg will be part of thread context
* When user thread is interruptted for the 1st time, the context is
saved in user stack (U bit of IRQ_CTLR is set to 1). When nest
interrupt comes, the context is saved in thread's privilege stack
* the arc_mpu_regions.c is moved to board folder, as it's board
specific
* the above codes have been tested through tests/kernel/mem_protect/
userspace for MPU version 2
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-01-23 17:13:09 +08:00
|
|
|
#ifdef CONFIG_USERSPACE
|
2018-02-01 16:34:47 +08:00
|
|
|
#ifdef CONFIG_ARC_HAS_SECURE
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, kernel_sp);
|
arch: arc: add user space support for arc
* add the implementation of syscall
* based on 'trap_s' intruction, id = 3
* add the privilege stack
* the privilege stack is allocted with thread stack
* for the kernel thread, the privilege stack is also a
part of thread stack, the start of stack can be configured
as stack guard
* for the user thread, no stack guard, when the user stack is
overflow, it will fall into kernel memory area which requires
kernel privilege, privilege violation will be raised
* modify the linker template and add MPU_ADDR_ALIGN
* add user space corresponding codes in mpu
* the user sp aux reg will be part of thread context
* When user thread is interruptted for the 1st time, the context is
saved in user stack (U bit of IRQ_CTLR is set to 1). When nest
interrupt comes, the context is saved in thread's privilege stack
* the arc_mpu_regions.c is moved to board folder, as it's board
specific
* the above codes have been tested through tests/kernel/mem_protect/
userspace for MPU version 2
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-01-23 17:13:09 +08:00
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, user_sp);
|
2018-02-01 16:34:47 +08:00
|
|
|
#else
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, user_sp);
|
|
|
|
#endif
|
arch: arc: add user space support for arc
* add the implementation of syscall
* based on 'trap_s' intruction, id = 3
* add the privilege stack
* the privilege stack is allocted with thread stack
* for the kernel thread, the privilege stack is also a
part of thread stack, the start of stack can be configured
as stack guard
* for the user thread, no stack guard, when the user stack is
overflow, it will fall into kernel memory area which requires
kernel privilege, privilege violation will be raised
* modify the linker template and add MPU_ADDR_ALIGN
* add user space corresponding codes in mpu
* the user sp aux reg will be part of thread context
* When user thread is interruptted for the 1st time, the context is
saved in user stack (U bit of IRQ_CTLR is set to 1). When nest
interrupt comes, the context is saved in thread's privilege stack
* the arc_mpu_regions.c is moved to board folder, as it's board
specific
* the above codes have been tested through tests/kernel/mem_protect/
userspace for MPU version 2
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-01-23 17:13:09 +08:00
|
|
|
#endif
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r30);
|
boards: Update arc em_starterkit support from 2.2 to 2.3
Here are the main changes:
* board: Update EMSK onboard resources such as Button, Switch and LEDs
+ update soc.h for em7d, em9d, em11d
+ update board.h for em_starterkit board
* arc: Add floating point support and code density support
+ add kconfig configuration
+ add compiler options
+ add register definitions, marcos, assembly codes
+ fixes in existing codes and configurations.
* arc: Update detailed board configurations for cores of emsk 2.3
* script: Provide arc_debugger.sh for debugging em_starterkit board
+ make BOARD=em_starterkit debug
This will start openocd server for emsk, and arc gdb will connect
to this debug server, user can run `continue` command if user just
want to run the application, or other commands if debugging needed.
+ make BOARD=em_starterkit debugserver
This will start an openocd debugger server for emsk, and user can
connect to this debugserver using arc gdb and do what they want to.
+ make BOARD=em_starterkit flash
This will download the zephyr application elf file to emsk,
and run it.
Signed-off-by: Huaqi Fang <huaqi.fang@synopsys.com>
2017-05-17 15:18:51 +08:00
|
|
|
#ifdef CONFIG_FP_SHARING
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r58);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, r59);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, fpu_status);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, fpu_ctrl);
|
|
|
|
#ifdef CONFIG_FP_FPU_DA
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, dpfp2h);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, dpfp2l);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, dpfp1h);
|
|
|
|
GEN_OFFSET_SYM(_callee_saved_stack_t, dpfp1l);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_ABSOLUTE_SYM(___callee_saved_stack_t_SIZEOF, sizeof(_callee_saved_stack_t));
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2016-11-08 23:36:50 +08:00
|
|
|
GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF, sizeof(struct k_thread));
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
GEN_ABS_SYM_END
|