* 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>
36 lines
600 B
ArmAsm
36 lines
600 B
ArmAsm
/*
|
|
* Copyright (c) 2014-2015 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Wrapper for _thread_entry
|
|
*
|
|
* Wrapper for _thread_entry routine when called from the initial context.
|
|
*/
|
|
|
|
#include <toolchain.h>
|
|
#include <linker/sections.h>
|
|
|
|
GTEXT(_thread_entry_wrapper)
|
|
|
|
/*
|
|
* @brief Wrapper for _thread_entry
|
|
*
|
|
* The routine pops parameters for the _thread_entry from stack frame, prepared
|
|
* by the _new_thread() routine.
|
|
*
|
|
* @return N/A
|
|
*/
|
|
|
|
SECTION_FUNC(TEXT, _thread_entry_wrapper)
|
|
|
|
pop_s r3
|
|
pop_s r2
|
|
pop_s r1
|
|
pop_s r0
|
|
j _thread_entry
|
|
nop
|