1 /*
2 * Copyright (c) 2006-2020, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 */
9
10 #ifndef LWP_ARCH_H__
11 #define LWP_ARCH_H__
12
13 #include <lwp.h>
14 #include <lwp_arch_comm.h>
15
16 #ifdef ARCH_MM_MMU
17
18 #define USER_VADDR_TOP 0xC0000000UL
19 #define USER_HEAP_VEND 0xB0000000UL
20 #define USER_HEAP_VADDR 0x80000000UL
21 #define USER_STACK_VSTART 0x70000000UL
22 #define USER_STACK_VEND USER_HEAP_VADDR
23 #define LDSO_LOAD_VADDR 0x60000000UL
24 #define USER_VADDR_START 0x00010000UL
25 #define USER_LOAD_VADDR USER_VADDR_START
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
rt_hw_ffz(unsigned long x)31 rt_inline unsigned long rt_hw_ffz(unsigned long x)
32 {
33 return __builtin_ffsl(~x) - 1;
34 }
35
icache_invalid_all(void)36 rt_inline void icache_invalid_all(void)
37 {
38 __asm__ volatile ("mcr p15, 0, r0, c7, c5, 0\ndsb\nisb":::"memory");//iciallu
39 }
40
41 unsigned int arch_get_asid(struct rt_lwp *lwp);
42
43 struct signal_regs;
44 void *arch_signal_ucontext_restore(rt_base_t user_sp);
45 void *arch_signal_ucontext_save(rt_base_t lr, siginfo_t *psiginfo,
46 struct signal_regs *exp_frame, rt_base_t user_sp,
47 lwp_sigset_t *save_sig_mask);
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif
54
55 #endif /*LWP_ARCH_H__*/
56