arch/arm: Remove FAR and CODE from common/ and arm*/ folder
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
7a0fd8d10f
commit
7c5b2e3305
@ -65,7 +65,7 @@ do { \
|
||||
"\tmov %0, " PIC_REG_STRING "\n\t" \
|
||||
: "=r"(picbase) \
|
||||
); \
|
||||
*ppicbase = (FAR void*)picbase; \
|
||||
*ppicbase = (void *)picbase; \
|
||||
} while (0)
|
||||
|
||||
#define up_setpicbase(picbase) \
|
||||
@ -129,12 +129,12 @@ struct group_addrenv_s
|
||||
{
|
||||
/* Level 1 page table entries for each group section */
|
||||
|
||||
FAR uintptr_t *text[ARCH_TEXT_NSECTS];
|
||||
FAR uintptr_t *data[ARCH_DATA_NSECTS];
|
||||
uintptr_t *text[ARCH_TEXT_NSECTS];
|
||||
uintptr_t *data[ARCH_DATA_NSECTS];
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
FAR uintptr_t *heap[ARCH_HEAP_NSECTS];
|
||||
uintptr_t *heap[ARCH_HEAP_NSECTS];
|
||||
#ifdef CONFIG_MM_SHM
|
||||
FAR uintptr_t *shm[ARCH_SHM_NSECTS];
|
||||
uintptr_t *shm[ARCH_SHM_NSECTS];
|
||||
#endif
|
||||
|
||||
/* Initial heap allocation (in bytes). This exists only provide an
|
||||
@ -160,12 +160,12 @@ typedef struct group_addrenv_s group_addrenv_t;
|
||||
|
||||
struct save_addrenv_s
|
||||
{
|
||||
FAR uint32_t text[ARCH_TEXT_NSECTS];
|
||||
FAR uint32_t data[ARCH_DATA_NSECTS];
|
||||
uint32_t text[ARCH_TEXT_NSECTS];
|
||||
uint32_t data[ARCH_DATA_NSECTS];
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
FAR uint32_t heap[ARCH_HEAP_NSECTS];
|
||||
uint32_t heap[ARCH_HEAP_NSECTS];
|
||||
#ifdef CONFIG_MM_SHM
|
||||
FAR uint32_t shm[ARCH_SHM_NSECTS];
|
||||
uint32_t shm[ARCH_SHM_NSECTS];
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
@ -295,7 +295,7 @@ struct xcptcontext
|
||||
* handling to support dynamically sized stacks for each thread.
|
||||
*/
|
||||
|
||||
FAR uintptr_t *ustack[ARCH_STACK_NSECTS];
|
||||
uintptr_t *ustack[ARCH_STACK_NSECTS];
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
@ -307,9 +307,9 @@ struct xcptcontext
|
||||
* stack in place.
|
||||
*/
|
||||
|
||||
FAR uint32_t *ustkptr; /* Saved user stack pointer */
|
||||
FAR uint32_t *kstack; /* Allocate base of the (aligned) kernel stack */
|
||||
FAR uint32_t *kstkptr; /* Saved kernel stack pointer */
|
||||
uint32_t *ustkptr; /* Saved user stack pointer */
|
||||
uint32_t *kstack; /* Allocate base of the (aligned) kernel stack */
|
||||
uint32_t *kstkptr; /* Saved kernel stack pointer */
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
@ -118,7 +118,7 @@ struct xcptcontext
|
||||
* are pending signals to be processed.
|
||||
*/
|
||||
|
||||
FAR void *sigdeliver; /* Actual type is sig_deliver_t */
|
||||
void *sigdeliver; /* Actual type is sig_deliver_t */
|
||||
|
||||
/* These are saved copies of the context used during
|
||||
* signal processing.
|
||||
|
@ -294,7 +294,7 @@ struct xcptcontext
|
||||
* handling to support dynamically sized stacks for each thread.
|
||||
*/
|
||||
|
||||
FAR uintptr_t *ustack[ARCH_STACK_NSECTS];
|
||||
uintptr_t *ustack[ARCH_STACK_NSECTS];
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
@ -306,9 +306,9 @@ struct xcptcontext
|
||||
* stack in place.
|
||||
*/
|
||||
|
||||
FAR uint32_t *ustkptr; /* Saved user stack pointer */
|
||||
FAR uint32_t *kstack; /* Allocate base of the (aligned) kernel stack */
|
||||
FAR uint32_t *kstkptr; /* Saved kernel stack pointer */
|
||||
uint32_t *ustkptr; /* Saved user stack pointer */
|
||||
uint32_t *kstack; /* Allocate base of the (aligned) kernel stack */
|
||||
uint32_t *kstkptr; /* Saved kernel stack pointer */
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
@ -123,7 +123,7 @@ struct xcptcontext
|
||||
* are pending signals to be processed.
|
||||
*/
|
||||
|
||||
FAR void *sigdeliver; /* Actual type is sig_deliver_t */
|
||||
void *sigdeliver; /* Actual type is sig_deliver_t */
|
||||
|
||||
/* These are saved copies of the context used during
|
||||
* signal processing.
|
||||
|
@ -97,7 +97,7 @@
|
||||
#ifndef CONFIG_BUILD_FLAT
|
||||
/* SYS call 4:
|
||||
*
|
||||
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
|
||||
* void up_task_start(main_t taskentry, int argc, char *argv[])
|
||||
* noreturn_function;
|
||||
*/
|
||||
|
||||
@ -115,8 +115,8 @@
|
||||
/* SYS call 6:
|
||||
*
|
||||
* void signal_handler(_sa_sigaction_t sighand,
|
||||
* int signo, FAR siginfo_t *info,
|
||||
* FAR void *ucontext);
|
||||
* int signo, siginfo_t *info,
|
||||
* void *ucontext);
|
||||
*/
|
||||
|
||||
#define SYS_signal_handler (6)
|
||||
|
@ -150,7 +150,7 @@ static bool g_pgwrap;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_allocpage(FAR struct tcb_s *tcb, FAR void **vpage)
|
||||
int up_allocpage(struct tcb_s *tcb, void **vpage)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
uintptr_t paddr;
|
||||
|
@ -83,7 +83,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool up_checkmapping(FAR struct tcb_s *tcb)
|
||||
bool up_checkmapping(struct tcb_s *tcb)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
uint32_t *pte;
|
||||
|
@ -82,9 +82,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
|
@ -134,10 +134,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -176,7 +176,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
|
@ -46,7 +46,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_dumpnvic(FAR const char *msg)
|
||||
void arm_dumpnvic(const char *msg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_INFO
|
||||
irqstate_t flags;
|
||||
|
@ -65,7 +65,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_hardfault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
|
||||
|
@ -83,9 +83,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
|
@ -100,7 +100,7 @@ void arm_ramvec_initialize(void)
|
||||
* protect against NULL pointer references.
|
||||
*/
|
||||
|
||||
src = (const CODE up_vector_t *)getreg32(ARMV6M_SYSCON_VECTAB);
|
||||
src = (const up_vector_t *)getreg32(ARMV6M_SYSCON_VECTAB);
|
||||
dest = g_ram_vectors;
|
||||
|
||||
irqinfo("src=%p dest=%p\n", src, dest);
|
||||
|
@ -123,7 +123,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* And make sure that the saved context in the TCB is the same
|
||||
* as the interrupt return context.
|
||||
@ -136,10 +136,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -172,7 +172,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* by the signal trampoline after the signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -183,7 +183,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
@ -276,7 +276,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -287,7 +287,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs,
|
||||
@ -318,7 +318,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* And make sure that the saved context in the TCB is the
|
||||
* same as the interrupt return context.
|
||||
@ -331,10 +331,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -388,7 +388,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* by the signal trampoline after the signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -399,7 +399,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
|
@ -114,7 +114,7 @@ static void dispatch_syscall(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_svcall(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
uint32_t cmd;
|
||||
@ -268,7 +268,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
|
||||
/* R0=SYS_task_start: This a user task start
|
||||
*
|
||||
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
|
||||
* void up_task_start(main_t taskentry, int argc, char *argv[])
|
||||
* noreturn_function;
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
@ -335,7 +335,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
/* R0=SYS_signal_handler: This a user signal handler callback
|
||||
*
|
||||
* void signal_handler(_sa_sigaction_t sighand, int signo,
|
||||
* FAR siginfo_t *info, FAR void *ucontext);
|
||||
* siginfo_t *info, void *ucontext);
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
*
|
||||
@ -408,7 +408,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_LIB_SYSCALL
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
|
@ -378,7 +378,7 @@ extern "C"
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
void arm_dumpnvic(FAR const char *msg);
|
||||
void arm_dumpnvic(const char *msg);
|
||||
#else
|
||||
# define arm_dumpnvic(m)
|
||||
#endif
|
||||
|
@ -85,7 +85,7 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
int arm_addrenv_create_region(uintptr_t **list, unsigned int listlen,
|
||||
uintptr_t vaddr, size_t regionsize,
|
||||
uint32_t mmuflags);
|
||||
|
||||
@ -97,7 +97,7 @@ int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_addrenv_destroy_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
void arm_addrenv_destroy_region(uintptr_t **list, unsigned int listlen,
|
||||
uintptr_t vaddr, bool keep);
|
||||
|
||||
#undef EXTERN
|
||||
|
@ -147,7 +147,7 @@
|
||||
static int up_addrenv_initdata(uintptr_t l2table)
|
||||
{
|
||||
irqstate_t flags;
|
||||
FAR uint32_t *virtptr;
|
||||
uint32_t *virtptr;
|
||||
uintptr_t paddr;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
uint32_t l1save;
|
||||
@ -161,13 +161,13 @@ static int up_addrenv_initdata(uintptr_t l2table)
|
||||
* address
|
||||
*/
|
||||
|
||||
virtptr = (FAR uint32_t *)arm_pgvaddr(l2table);
|
||||
virtptr = (uint32_t *)arm_pgvaddr(l2table);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(l2table & ~SECTION_MASK, ARCH_SCRATCH_VBASE, MMU_MEMFLAGS);
|
||||
virtptr = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | (l2table & SECTION_MASK));
|
||||
virtptr = (uint32_t *)(ARCH_SCRATCH_VBASE | (l2table & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
/* Invalidate D-Cache so that we read from the physical memory */
|
||||
@ -183,12 +183,12 @@ static int up_addrenv_initdata(uintptr_t l2table)
|
||||
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
/* Get the virtual address corresponding to the physical page address */
|
||||
|
||||
virtptr = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
virtptr = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, MMU_MEMFLAGS);
|
||||
virtptr = (FAR uint32_t *)(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK));
|
||||
virtptr = (uint32_t *)(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
/* Finally, after of all of that, we can initialize the tiny region at
|
||||
@ -246,7 +246,7 @@ static int up_addrenv_initdata(uintptr_t l2table)
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
|
||||
FAR group_addrenv_t *addrenv)
|
||||
group_addrenv_t *addrenv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -349,7 +349,7 @@ errout:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_destroy(FAR group_addrenv_t *addrenv)
|
||||
int up_addrenv_destroy(group_addrenv_t *addrenv)
|
||||
{
|
||||
binfo("addrenv=%p\n", addrenv);
|
||||
DEBUGASSERT(addrenv);
|
||||
@ -401,14 +401,14 @@ int up_addrenv_destroy(FAR group_addrenv_t *addrenv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_vtext(FAR group_addrenv_t *addrenv, FAR void **vtext)
|
||||
int up_addrenv_vtext(group_addrenv_t *addrenv, void **vtext)
|
||||
{
|
||||
binfo("return=%p\n", (FAR void *)CONFIG_ARCH_TEXT_VBASE);
|
||||
binfo("return=%p\n", (void *)CONFIG_ARCH_TEXT_VBASE);
|
||||
|
||||
/* Not much to do in this case */
|
||||
|
||||
DEBUGASSERT(addrenv && vtext);
|
||||
*vtext = (FAR void *)CONFIG_ARCH_TEXT_VBASE;
|
||||
*vtext = (void *)CONFIG_ARCH_TEXT_VBASE;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -434,16 +434,16 @@ int up_addrenv_vtext(FAR group_addrenv_t *addrenv, FAR void **vtext)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_vdata(FAR group_addrenv_t *addrenv, uintptr_t textsize,
|
||||
FAR void **vdata)
|
||||
int up_addrenv_vdata(group_addrenv_t *addrenv, uintptr_t textsize,
|
||||
void **vdata)
|
||||
{
|
||||
binfo("return=%p\n",
|
||||
(FAR void *)(CONFIG_ARCH_DATA_VBASE + ARCH_DATA_RESERVE_SIZE));
|
||||
(void *)(CONFIG_ARCH_DATA_VBASE + ARCH_DATA_RESERVE_SIZE));
|
||||
|
||||
/* Not much to do in this case */
|
||||
|
||||
DEBUGASSERT(addrenv && vdata);
|
||||
*vdata = (FAR void *)(CONFIG_ARCH_DATA_VBASE + ARCH_DATA_RESERVE_SIZE);
|
||||
*vdata = (void *)(CONFIG_ARCH_DATA_VBASE + ARCH_DATA_RESERVE_SIZE);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ int up_addrenv_vdata(FAR group_addrenv_t *addrenv, uintptr_t textsize,
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
ssize_t up_addrenv_heapsize(FAR const group_addrenv_t *addrenv)
|
||||
ssize_t up_addrenv_heapsize(const group_addrenv_t *addrenv)
|
||||
{
|
||||
DEBUGASSERT(addrenv);
|
||||
return (ssize_t)addrenv->heapsize;
|
||||
@ -499,8 +499,8 @@ ssize_t up_addrenv_heapsize(FAR const group_addrenv_t *addrenv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_select(FAR const group_addrenv_t *addrenv,
|
||||
FAR save_addrenv_t *oldenv)
|
||||
int up_addrenv_select(const group_addrenv_t *addrenv,
|
||||
save_addrenv_t *oldenv)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
uintptr_t paddr;
|
||||
@ -636,7 +636,7 @@ int up_addrenv_select(FAR const group_addrenv_t *addrenv,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_restore(FAR const save_addrenv_t *oldenv)
|
||||
int up_addrenv_restore(const save_addrenv_t *oldenv)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
int i;
|
||||
@ -704,7 +704,7 @@ int up_addrenv_restore(FAR const save_addrenv_t *oldenv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_coherent(FAR const group_addrenv_t *addrenv)
|
||||
int up_addrenv_coherent(const group_addrenv_t *addrenv)
|
||||
{
|
||||
DEBUGASSERT(addrenv);
|
||||
|
||||
@ -754,8 +754,8 @@ int up_addrenv_coherent(FAR const group_addrenv_t *addrenv)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_clone(FAR const group_addrenv_t *src,
|
||||
FAR group_addrenv_t *dest)
|
||||
int up_addrenv_clone(const group_addrenv_t *src,
|
||||
group_addrenv_t *dest)
|
||||
{
|
||||
binfo("src=%p dest=%p\n", src, dest);
|
||||
DEBUGASSERT(src && dest);
|
||||
@ -787,7 +787,7 @@ int up_addrenv_clone(FAR const group_addrenv_t *src,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_attach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
|
||||
int up_addrenv_attach(struct task_group_s *group, struct tcb_s *tcb)
|
||||
{
|
||||
binfo("group=%p tcb=%p\n", group, tcb);
|
||||
|
||||
@ -820,7 +820,7 @@ int up_addrenv_attach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_detach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
|
||||
int up_addrenv_detach(struct task_group_s *group, struct tcb_s *tcb)
|
||||
{
|
||||
binfo("group=%p tcb=%p\n", group, tcb);
|
||||
|
||||
|
@ -129,7 +129,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_kstackalloc(FAR struct tcb_s *tcb)
|
||||
int up_addrenv_kstackalloc(struct tcb_s *tcb)
|
||||
{
|
||||
binfo("tcb=%p stacksize=%u\n", tcb, ARCH_KERNEL_STACKSIZE);
|
||||
|
||||
@ -137,7 +137,7 @@ int up_addrenv_kstackalloc(FAR struct tcb_s *tcb)
|
||||
|
||||
/* Allocate the kernel stack */
|
||||
|
||||
tcb->xcp.kstack = (FAR uint32_t *)kmm_memalign(8, ARCH_KERNEL_STACKSIZE);
|
||||
tcb->xcp.kstack = (uint32_t *)kmm_memalign(8, ARCH_KERNEL_STACKSIZE);
|
||||
if (!tcb->xcp.kstack)
|
||||
{
|
||||
berr("ERROR: Failed to allocate the kernel stack\n");
|
||||
@ -162,7 +162,7 @@ int up_addrenv_kstackalloc(FAR struct tcb_s *tcb)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_kstackfree(FAR struct tcb_s *tcb)
|
||||
int up_addrenv_kstackfree(struct tcb_s *tcb)
|
||||
{
|
||||
binfo("tcb=%p\n", tcb);
|
||||
DEBUGASSERT(tcb);
|
||||
|
@ -63,12 +63,12 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_shmat(FAR uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
|
||||
int up_shmat(uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
|
||||
{
|
||||
FAR struct tcb_s *tcb = nxsched_self();
|
||||
FAR struct task_group_s *group;
|
||||
FAR uintptr_t *l1entry;
|
||||
FAR uint32_t *l2table;
|
||||
struct tcb_s *tcb = nxsched_self();
|
||||
struct task_group_s *group;
|
||||
uintptr_t *l1entry;
|
||||
uint32_t *l2table;
|
||||
irqstate_t flags;
|
||||
uintptr_t paddr;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
@ -118,21 +118,21 @@ int up_shmat(FAR uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
|
||||
*/
|
||||
|
||||
flags = enter_critical_section();
|
||||
group->tg_addrenv.shm[shmndx] = (FAR uintptr_t *)paddr;
|
||||
group->tg_addrenv.shm[shmndx] = (uintptr_t *)paddr;
|
||||
|
||||
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
/* Get the virtual address corresponding to the physical page
|
||||
* address.
|
||||
*/
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
|
||||
MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)
|
||||
l2table = (uint32_t *)
|
||||
(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
@ -154,14 +154,14 @@ int up_shmat(FAR uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
|
||||
* address.
|
||||
*/
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
|
||||
MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)
|
||||
l2table = (uint32_t *)
|
||||
(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK));
|
||||
#endif
|
||||
}
|
||||
@ -216,10 +216,10 @@ int up_shmat(FAR uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
|
||||
|
||||
int up_shmdt(uintptr_t vaddr, unsigned int npages)
|
||||
{
|
||||
FAR struct tcb_s *tcb = nxsched_self();
|
||||
FAR struct task_group_s *group;
|
||||
FAR uintptr_t *l1entry;
|
||||
FAR uint32_t *l2table;
|
||||
struct tcb_s *tcb = nxsched_self();
|
||||
struct task_group_s *group;
|
||||
uintptr_t *l1entry;
|
||||
uint32_t *l2table;
|
||||
irqstate_t flags;
|
||||
uintptr_t paddr;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
@ -265,14 +265,14 @@ int up_shmdt(uintptr_t vaddr, unsigned int npages)
|
||||
* address.
|
||||
*/
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
|
||||
MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)
|
||||
l2table = (uint32_t *)
|
||||
(ARCH_SCRATCH_VBASE | (paddr & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
|
@ -126,7 +126,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_ustackalloc(FAR struct tcb_s *tcb, size_t stacksize)
|
||||
int up_addrenv_ustackalloc(struct tcb_s *tcb, size_t stacksize)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@ -175,7 +175,7 @@ int up_addrenv_ustackalloc(FAR struct tcb_s *tcb, size_t stacksize)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_ustackfree(FAR struct tcb_s *tcb)
|
||||
int up_addrenv_ustackfree(struct tcb_s *tcb)
|
||||
{
|
||||
binfo("tcb=%p\n", tcb);
|
||||
DEBUGASSERT(tcb);
|
||||
@ -206,14 +206,14 @@ int up_addrenv_ustackfree(FAR struct tcb_s *tcb)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_vustack(FAR const struct tcb_s *tcb, FAR void **vstack)
|
||||
int up_addrenv_vustack(const struct tcb_s *tcb, void **vstack)
|
||||
{
|
||||
binfo("Return=%p\n", (FAR void *)CONFIG_ARCH_STACK_VBASE);
|
||||
binfo("Return=%p\n", (void *)CONFIG_ARCH_STACK_VBASE);
|
||||
|
||||
/* Not much to do in this case */
|
||||
|
||||
DEBUGASSERT(tcb);
|
||||
*vstack = (FAR void *)CONFIG_ARCH_STACK_VBASE;
|
||||
*vstack = (void *)CONFIG_ARCH_STACK_VBASE;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ int up_addrenv_vustack(FAR const struct tcb_s *tcb, FAR void **vstack)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_addrenv_ustackselect(FAR const struct tcb_s *tcb)
|
||||
int up_addrenv_ustackselect(const struct tcb_s *tcb)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
uintptr_t paddr;
|
||||
|
@ -55,13 +55,13 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
int arm_addrenv_create_region(uintptr_t **list, unsigned int listlen,
|
||||
uintptr_t vaddr, size_t regionsize,
|
||||
uint32_t mmuflags)
|
||||
{
|
||||
irqstate_t flags;
|
||||
uintptr_t paddr;
|
||||
FAR uint32_t *l2table;
|
||||
uint32_t *l2table;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
uint32_t l1save;
|
||||
#endif
|
||||
@ -106,21 +106,21 @@ int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
}
|
||||
|
||||
DEBUGASSERT(MM_ISALIGNED(paddr));
|
||||
list[i] = (FAR uintptr_t *)paddr;
|
||||
list[i] = (uintptr_t *)paddr;
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
/* Get the virtual address corresponding to the physical page address */
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
|
||||
MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
l2table = (uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
(paddr & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
@ -179,12 +179,12 @@ int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_addrenv_destroy_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
void arm_addrenv_destroy_region(uintptr_t **list, unsigned int listlen,
|
||||
uintptr_t vaddr, bool keep)
|
||||
{
|
||||
irqstate_t flags;
|
||||
uintptr_t paddr;
|
||||
FAR uint32_t *l2table;
|
||||
uint32_t *l2table;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
uint32_t l1save;
|
||||
#endif
|
||||
@ -211,14 +211,14 @@ void arm_addrenv_destroy_region(FAR uintptr_t **list, unsigned int listlen,
|
||||
* address
|
||||
*/
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
|
||||
MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
l2table = (uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
(paddr & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
|
@ -142,7 +142,7 @@ static bool g_pgwrap;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_allocpage(FAR struct tcb_s *tcb, FAR void **vpage)
|
||||
int arm_allocpage(struct tcb_s *tcb, void **vpage)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
uintptr_t paddr;
|
||||
|
@ -69,7 +69,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool arm_checkmapping(FAR struct tcb_s *tcb)
|
||||
bool arm_checkmapping(struct tcb_s *tcb)
|
||||
{
|
||||
uintptr_t vaddr;
|
||||
uint32_t *pte;
|
||||
|
@ -48,7 +48,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#if CONFIG_SMP_NCPUS > 1
|
||||
static FAR const uint32_t *g_cpu_stackalloc[CONFIG_SMP_NCPUS] =
|
||||
static const uint32_t *g_cpu_stackalloc[CONFIG_SMP_NCPUS] =
|
||||
{
|
||||
0
|
||||
, g_cpu1_idlestack
|
||||
@ -108,7 +108,7 @@ static FAR const uint32_t *g_cpu_stackalloc[CONFIG_SMP_NCPUS] =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size)
|
||||
int up_cpu_idlestack(int cpu, struct tcb_s *tcb, size_t stack_size)
|
||||
{
|
||||
#if CONFIG_SMP_NCPUS > 1
|
||||
uintptr_t stack_alloc;
|
||||
@ -122,7 +122,7 @@ int up_cpu_idlestack(int cpu, FAR struct tcb_s *tcb, size_t stack_size)
|
||||
DEBUGASSERT(stack_alloc != 0 && STACK_ISALIGNED(stack_alloc));
|
||||
|
||||
tcb->adj_stack_size = SMP_STACK_SIZE;
|
||||
tcb->stack_alloc_ptr = (FAR void *)stack_alloc;
|
||||
tcb->stack_alloc_ptr = (void *)stack_alloc;
|
||||
tcb->stack_base_ptr = tcb->stack_alloc_ptr;
|
||||
#endif
|
||||
|
||||
|
@ -112,7 +112,7 @@ bool up_cpu_pausereq(int cpu)
|
||||
|
||||
int up_cpu_paused(int cpu)
|
||||
{
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
struct tcb_s *tcb = this_task();
|
||||
|
||||
/* Update scheduler parameters */
|
||||
|
||||
@ -188,7 +188,7 @@ int up_cpu_paused(int cpu)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_pause_handler(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_pause_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
int cpu = this_cpu();
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* Was useful in solving some startup problems */
|
||||
static inline void arm_registerdump(FAR struct tcb_s *tcb)
|
||||
static inline void arm_registerdump(struct tcb_s *tcb)
|
||||
{
|
||||
int regndx;
|
||||
|
||||
@ -90,9 +90,9 @@ static inline void arm_registerdump(FAR struct tcb_s *tcb)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_start_handler(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_start_handler(int irq, void *context, void *arg)
|
||||
{
|
||||
FAR struct tcb_s *tcb = this_task();
|
||||
struct tcb_s *tcb = this_task();
|
||||
|
||||
sinfo("CPU%d Started\n", this_cpu());
|
||||
|
||||
|
@ -82,9 +82,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
|
@ -55,7 +55,7 @@ static uintptr_t alloc_pgtable(void)
|
||||
{
|
||||
irqstate_t flags;
|
||||
uintptr_t paddr;
|
||||
FAR uint32_t *l2table;
|
||||
uint32_t *l2table;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
uint32_t l1save;
|
||||
#endif
|
||||
@ -73,14 +73,14 @@ static uintptr_t alloc_pgtable(void)
|
||||
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
/* Get the virtual address corresponding to the physical page address */
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
|
||||
MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
l2table = (uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
(paddr & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
@ -115,7 +115,7 @@ static uintptr_t alloc_pgtable(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int get_pgtable(FAR group_addrenv_t *addrenv, uintptr_t vaddr)
|
||||
static int get_pgtable(group_addrenv_t *addrenv, uintptr_t vaddr)
|
||||
{
|
||||
uint32_t l1entry;
|
||||
uintptr_t paddr;
|
||||
@ -150,7 +150,7 @@ static int get_pgtable(FAR group_addrenv_t *addrenv, uintptr_t vaddr)
|
||||
*/
|
||||
|
||||
l1entry = paddr | MMU_L1_PGTABFLAGS;
|
||||
addrenv->heap[hpndx] = (FAR uintptr_t *)l1entry;
|
||||
addrenv->heap[hpndx] = (uintptr_t *)l1entry;
|
||||
|
||||
/* And instantiate the modified environment */
|
||||
|
||||
@ -200,9 +200,9 @@ static int get_pgtable(FAR group_addrenv_t *addrenv, uintptr_t vaddr)
|
||||
|
||||
uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages)
|
||||
{
|
||||
FAR struct tcb_s *tcb = nxsched_self();
|
||||
FAR struct task_group_s *group;
|
||||
FAR uint32_t *l2table;
|
||||
struct tcb_s *tcb = nxsched_self();
|
||||
struct task_group_s *group;
|
||||
uint32_t *l2table;
|
||||
irqstate_t flags;
|
||||
uintptr_t paddr;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
@ -250,7 +250,7 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages)
|
||||
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
/* Get the virtual address corresponding to the physical page address */
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the level 2 page table into the "scratch" virtual
|
||||
* address space
|
||||
@ -259,7 +259,7 @@ uintptr_t pgalloc(uintptr_t brkaddr, unsigned int npages)
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE,
|
||||
MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
l2table = (uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
(paddr & SECTION_MASK));
|
||||
#endif
|
||||
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
uintptr_t arm_physpgaddr(uintptr_t vaddr)
|
||||
{
|
||||
FAR uint32_t *l2table;
|
||||
uint32_t *l2table;
|
||||
uintptr_t paddr;
|
||||
uint32_t l1entry;
|
||||
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
@ -84,14 +84,14 @@ uintptr_t arm_physpgaddr(uintptr_t vaddr)
|
||||
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
|
||||
/* Get the virtual address of the base of level 2 page table */
|
||||
|
||||
l2table = (FAR uint32_t *)arm_pgvaddr(paddr);
|
||||
l2table = (uint32_t *)arm_pgvaddr(paddr);
|
||||
#else
|
||||
/* Temporarily map the page into the virtual address space */
|
||||
|
||||
l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK,
|
||||
ARCH_SCRATCH_VBASE, MMU_MEMFLAGS);
|
||||
l2table = (FAR uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
l2table = (uint32_t *)(ARCH_SCRATCH_VBASE |
|
||||
(paddr & SECTION_MASK));
|
||||
#endif
|
||||
if (l2table)
|
||||
|
@ -139,10 +139,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -184,7 +184,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
@ -286,7 +286,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs,
|
||||
@ -316,7 +316,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* And make sure that the saved context in the TCB is the
|
||||
* same as the interrupt return context.
|
||||
@ -329,10 +329,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -397,7 +397,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
|
@ -196,7 +196,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
#ifdef CONFIG_LIB_SYSCALL
|
||||
case SYS_syscall_return:
|
||||
{
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = (int)rtcb->xcp.nsyscalls - 1;
|
||||
|
||||
/* Make sure that there is a saved SYSCALL return address. */
|
||||
@ -294,7 +294,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
/* R0=SYS_task_start: This a user task start
|
||||
*
|
||||
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
|
||||
* void up_task_start(main_t taskentry, int argc, char *argv[])
|
||||
* noreturn_function;
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
@ -365,7 +365,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
/* R0=SYS_signal_handler: This a user signal handler callback
|
||||
*
|
||||
* void signal_handler(_sa_sigaction_t sighand, int signo,
|
||||
* FAR siginfo_t *info, FAR void *ucontext);
|
||||
* siginfo_t *info, void *ucontext);
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
*
|
||||
@ -378,7 +378,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
case SYS_signal_handler:
|
||||
{
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
|
||||
/* Remember the caller's return address */
|
||||
|
||||
@ -415,7 +415,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
DEBUGASSERT(rtcb->xcp.kstkptr == NULL &&
|
||||
rtcb->xcp.ustkptr != NULL);
|
||||
|
||||
rtcb->xcp.kstkptr = (FAR uint32_t *)regs[REG_SP];
|
||||
rtcb->xcp.kstkptr = (uint32_t *)regs[REG_SP];
|
||||
regs[REG_SP] = (uint32_t)rtcb->xcp.ustkptr;
|
||||
}
|
||||
#endif
|
||||
@ -435,7 +435,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
case SYS_signal_handler_return:
|
||||
{
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
|
||||
/* Set up to return to the kernel-mode signal dispatching logic. */
|
||||
|
||||
@ -473,7 +473,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_LIB_SYSCALL
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
@ -513,7 +513,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
if (index == 0 && rtcb->xcp.kstack != NULL)
|
||||
{
|
||||
rtcb->xcp.ustkptr = (FAR uint32_t *)regs[REG_SP];
|
||||
rtcb->xcp.ustkptr = (uint32_t *)regs[REG_SP];
|
||||
regs[REG_SP] = (uint32_t)rtcb->xcp.kstack +
|
||||
ARCH_KERNEL_STACKSIZE;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ static void sig_trampoline(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void _start(int argc, FAR char *argv[])
|
||||
void _start(int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -797,7 +797,7 @@ uint32_t *arm_decodeirq(uint32_t *regs);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
int arm_start_handler(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_start_handler(int irq, void *context, void *arg);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -821,7 +821,7 @@ int arm_start_handler(int irq, FAR void *context, FAR void *arg);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
int arm_pause_handler(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_pause_handler(int irq, void *context, void *arg);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -58,7 +58,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_ARCH_PGPOOL_MAPPING) && defined(CONFIG_ARCH_USE_MMU)
|
||||
static inline uintptr_t arm_tmpmap(uintptr_t paddr, FAR uint32_t *l1save)
|
||||
static inline uintptr_t arm_tmpmap(uintptr_t paddr, uint32_t *l1save)
|
||||
{
|
||||
*l1save = mmu_l1_getentry(ARCH_SCRATCH_VBASE);
|
||||
mmu_l1_setentry(paddr & ~SECTION_MASK, ARCH_SCRATCH_VBASE, MMU_MEMFLAGS);
|
||||
@ -138,7 +138,7 @@ static inline bool arm_uservaddr(uintptr_t vaddr)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void set_l2_entry(FAR uint32_t *l2table, uintptr_t paddr,
|
||||
static inline void set_l2_entry(uint32_t *l2table, uintptr_t paddr,
|
||||
uintptr_t vaddr, uint32_t mmuflags)
|
||||
{
|
||||
uint32_t index;
|
||||
@ -163,7 +163,7 @@ static inline void set_l2_entry(FAR uint32_t *l2table, uintptr_t paddr,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void clr_l2_entry(FAR uint32_t *l2table, uintptr_t vaddr)
|
||||
static inline void clr_l2_entry(uint32_t *l2table, uintptr_t vaddr)
|
||||
{
|
||||
uint32_t index;
|
||||
|
||||
@ -188,7 +188,7 @@ static inline void clr_l2_entry(FAR uint32_t *l2table, uintptr_t vaddr)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uintptr_t get_l2_entry(FAR uint32_t *l2table, uintptr_t vaddr)
|
||||
static inline uintptr_t get_l2_entry(uint32_t *l2table, uintptr_t vaddr)
|
||||
{
|
||||
uint32_t index;
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_busfault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_busfault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
||||
|
@ -71,7 +71,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_hardfault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t hfsr = getreg32(NVIC_HFAULTS);
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
@ -84,9 +84,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
|
@ -62,8 +62,8 @@
|
||||
|
||||
/* SYSLOG channel methods */
|
||||
|
||||
static int itm_putc(FAR struct syslog_channel_s *channel, int ch);
|
||||
static int itm_flush(FAR struct syslog_channel_s *channel);
|
||||
static int itm_putc(struct syslog_channel_s *channel, int ch);
|
||||
static int itm_flush(struct syslog_channel_s *channel);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -97,7 +97,7 @@ static const struct syslog_channel_s g_itm_channel =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int itm_putc(FAR struct syslog_channel_s *channel, int ch)
|
||||
static int itm_putc(struct syslog_channel_s *channel, int ch)
|
||||
{
|
||||
UNUSED(channel);
|
||||
|
||||
@ -127,7 +127,7 @@ static int itm_putc(FAR struct syslog_channel_s *channel, int ch)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int itm_flush(FAR struct syslog_channel_s *channel)
|
||||
static int itm_flush(struct syslog_channel_s *channel)
|
||||
{
|
||||
UNUSED(channel);
|
||||
return OK;
|
||||
|
@ -58,7 +58,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_memfault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_memfault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
||||
|
@ -40,7 +40,7 @@ static uint32_t g_cpu_freq;
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void up_perf_init(FAR void *arg)
|
||||
void up_perf_init(void *arg)
|
||||
{
|
||||
g_cpu_freq = (uint32_t)(uintptr_t)arg;
|
||||
|
||||
@ -66,7 +66,7 @@ uint32_t up_perf_gettime(void)
|
||||
return getreg32(DWT_CYCCNT);
|
||||
}
|
||||
|
||||
void up_perf_convert(uint32_t elapsed, FAR struct timespec *ts)
|
||||
void up_perf_convert(uint32_t elapsed, struct timespec *ts)
|
||||
{
|
||||
uint32_t left;
|
||||
|
||||
|
@ -129,7 +129,7 @@ void arm_ramvec_initialize(void)
|
||||
* protect against NULL pointer references.
|
||||
*/
|
||||
|
||||
src = (const CODE up_vector_t *)getreg32(NVIC_VECTAB);
|
||||
src = (const up_vector_t *)getreg32(NVIC_VECTAB);
|
||||
dest = g_ram_vectors;
|
||||
|
||||
irqinfo("src=%p dest=%p\n", src, dest);
|
||||
|
@ -124,7 +124,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* And make sure that the saved context in the TCB is the same
|
||||
* as the interrupt return context.
|
||||
@ -137,10 +137,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -177,7 +177,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* by the signal trampoline after the signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -188,7 +188,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
@ -285,7 +285,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -296,7 +296,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs,
|
||||
@ -331,7 +331,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* And make sure that the saved context in the TCB is the
|
||||
* same as the interrupt return context.
|
||||
@ -344,10 +344,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -405,7 +405,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* by the signal trampoline after the signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -416,7 +416,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
|
@ -122,7 +122,7 @@ static void dispatch_syscall(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_svcall(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
uint32_t cmd;
|
||||
@ -282,7 +282,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
|
||||
/* R0=SYS_task_start: This a user task start
|
||||
*
|
||||
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
|
||||
* void up_task_start(main_t taskentry, int argc, char *argv[])
|
||||
* noreturn_function;
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
@ -349,7 +349,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
/* R0=SYS_signal_handler: This a user signal handler callback
|
||||
*
|
||||
* void signal_handler(_sa_sigaction_t sighand, int signo,
|
||||
* FAR siginfo_t *info, FAR void *ucontext);
|
||||
* siginfo_t *info, void *ucontext);
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
*
|
||||
@ -422,7 +422,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_LIB_SYSCALL
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
|
@ -57,15 +57,15 @@ struct systick_lowerhalf_s
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int systick_start(FAR struct timer_lowerhalf_s *lower_);
|
||||
static int systick_stop(FAR struct timer_lowerhalf_s *lower_);
|
||||
static int systick_getstatus(FAR struct timer_lowerhalf_s *lower_,
|
||||
FAR struct timer_status_s *status);
|
||||
static int systick_settimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static int systick_start(struct timer_lowerhalf_s *lower_);
|
||||
static int systick_stop(struct timer_lowerhalf_s *lower_);
|
||||
static int systick_getstatus(struct timer_lowerhalf_s *lower_,
|
||||
struct timer_status_s *status);
|
||||
static int systick_settimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t timeout);
|
||||
static void systick_setcallback(FAR struct timer_lowerhalf_s *lower_,
|
||||
tccb_t callback, FAR void *arg);
|
||||
static int systick_maxtimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static void systick_setcallback(struct timer_lowerhalf_s *lower_,
|
||||
tccb_t callback, void *arg);
|
||||
static int systick_maxtimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t *maxtimeout);
|
||||
|
||||
/****************************************************************************
|
||||
@ -118,21 +118,21 @@ static bool systick_irq_pending(struct systick_lowerhalf_s *lower)
|
||||
}
|
||||
}
|
||||
|
||||
static int systick_start(FAR struct timer_lowerhalf_s *lower_)
|
||||
static int systick_start(struct timer_lowerhalf_s *lower_)
|
||||
{
|
||||
putreg32(0, NVIC_SYSTICK_CURRENT);
|
||||
modifyreg32(NVIC_SYSTICK_CTRL, 0, NVIC_SYSTICK_CTRL_ENABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_stop(FAR struct timer_lowerhalf_s *lower_)
|
||||
static int systick_stop(struct timer_lowerhalf_s *lower_)
|
||||
{
|
||||
modifyreg32(NVIC_SYSTICK_CTRL, NVIC_SYSTICK_CTRL_ENABLE, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_getstatus(FAR struct timer_lowerhalf_s *lower_,
|
||||
FAR struct timer_status_s *status)
|
||||
static int systick_getstatus(struct timer_lowerhalf_s *lower_,
|
||||
struct timer_status_s *status)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = (struct systick_lowerhalf_s *)lower_;
|
||||
irqstate_t flags = enter_critical_section();
|
||||
@ -165,7 +165,7 @@ static int systick_getstatus(FAR struct timer_lowerhalf_s *lower_,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_settimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static int systick_settimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t timeout)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = (struct systick_lowerhalf_s *)lower_;
|
||||
@ -198,8 +198,8 @@ static int systick_settimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void systick_setcallback(FAR struct timer_lowerhalf_s *lower_,
|
||||
CODE tccb_t callback, FAR void *arg)
|
||||
static void systick_setcallback(struct timer_lowerhalf_s *lower_,
|
||||
tccb_t callback, void *arg)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = (struct systick_lowerhalf_s *)lower_;
|
||||
|
||||
@ -209,7 +209,7 @@ static void systick_setcallback(FAR struct timer_lowerhalf_s *lower_,
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
|
||||
static int systick_maxtimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static int systick_maxtimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t *maxtimeout)
|
||||
{
|
||||
uint64_t maxtimeout64 = usec_from_count(
|
||||
@ -227,7 +227,7 @@ static int systick_maxtimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int systick_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = arg;
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_usagefault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_usagefault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
||||
|
@ -82,9 +82,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
|
@ -134,10 +134,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -180,7 +180,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
|
@ -193,7 +193,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
#ifdef CONFIG_LIB_SYSCALL
|
||||
case SYS_syscall_return:
|
||||
{
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = (int)rtcb->xcp.nsyscalls - 1;
|
||||
|
||||
/* Make sure that there is a saved SYSCALL return address. */
|
||||
@ -291,7 +291,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
/* R0=SYS_task_start: This a user task start
|
||||
*
|
||||
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
|
||||
* void up_task_start(main_t taskentry, int argc, char *argv[])
|
||||
* noreturn_function;
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
@ -362,7 +362,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
/* R0=SYS_signal_handler: This a user signal handler callback
|
||||
*
|
||||
* void signal_handler(_sa_sigaction_t sighand, int signo,
|
||||
* FAR siginfo_t *info, FAR void *ucontext);
|
||||
* siginfo_t *info, void *ucontext);
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
*
|
||||
@ -375,7 +375,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
case SYS_signal_handler:
|
||||
{
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
|
||||
/* Remember the caller's return address */
|
||||
|
||||
@ -412,7 +412,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
DEBUGASSERT(rtcb->xcp.kstkptr == NULL &&
|
||||
rtcb->xcp.ustkptr != NULL);
|
||||
|
||||
rtcb->xcp.kstkptr = (FAR uint32_t *)regs[REG_SP];
|
||||
rtcb->xcp.kstkptr = (uint32_t *)regs[REG_SP];
|
||||
regs[REG_SP] = (uint32_t)rtcb->xcp.ustkptr;
|
||||
}
|
||||
#endif
|
||||
@ -432,7 +432,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
case SYS_signal_handler_return:
|
||||
{
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
|
||||
/* Set up to return to the kernel-mode signal dispatching logic. */
|
||||
|
||||
@ -470,7 +470,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_LIB_SYSCALL
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
@ -510,7 +510,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
||||
|
||||
if (index == 0 && rtcb->xcp.kstack != NULL)
|
||||
{
|
||||
rtcb->xcp.ustkptr = (FAR uint32_t *)regs[REG_SP];
|
||||
rtcb->xcp.ustkptr = (uint32_t *)regs[REG_SP];
|
||||
regs[REG_SP] = (uint32_t)rtcb->xcp.kstack +
|
||||
ARCH_KERNEL_STACKSIZE;
|
||||
}
|
||||
|
@ -633,7 +633,7 @@ int arm_cpu_sgi(int sgi, unsigned int cpuset);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
int arm_start_handler(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_start_handler(int irq, void *context, void *arg);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -657,7 +657,7 @@ int arm_start_handler(int irq, FAR void *context, FAR void *arg);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
int arm_pause_handler(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_pause_handler(int irq, void *context, void *arg);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
@ -57,7 +57,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_busfault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_busfault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
||||
|
@ -71,7 +71,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_hardfault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t hfsr = getreg32(NVIC_HFAULTS);
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
@ -84,9 +84,9 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
|
||||
/* Initialize the context registers to stack top */
|
||||
|
||||
xcp->regs = (FAR void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
xcp->regs = (void *)((uint32_t)tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size -
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
/* Initialize the xcp registers */
|
||||
|
||||
|
@ -62,8 +62,8 @@
|
||||
|
||||
/* SYSLOG channel methods */
|
||||
|
||||
static int itm_putc(FAR struct syslog_channel_s *channel, int ch);
|
||||
static int itm_flush(FAR struct syslog_channel_s *channel);
|
||||
static int itm_putc(struct syslog_channel_s *channel, int ch);
|
||||
static int itm_flush(struct syslog_channel_s *channel);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
@ -97,7 +97,7 @@ static const struct syslog_channel_s g_itm_channel =
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int itm_putc(FAR struct syslog_channel_s *channel, int ch)
|
||||
static int itm_putc(struct syslog_channel_s *channel, int ch)
|
||||
{
|
||||
UNUSED(channel);
|
||||
|
||||
@ -127,7 +127,7 @@ static int itm_putc(FAR struct syslog_channel_s *channel, int ch)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int itm_flush(FAR struct syslog_channel_s *channel)
|
||||
static int itm_flush(struct syslog_channel_s *channel)
|
||||
{
|
||||
UNUSED(channel);
|
||||
return OK;
|
||||
|
@ -58,7 +58,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_memfault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_memfault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
||||
|
@ -40,7 +40,7 @@ static uint32_t g_cpu_freq;
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void up_perf_init(FAR void *arg)
|
||||
void up_perf_init(void *arg)
|
||||
{
|
||||
g_cpu_freq = (uint32_t)(uintptr_t)arg;
|
||||
|
||||
@ -66,7 +66,7 @@ uint32_t up_perf_gettime(void)
|
||||
return getreg32(DWT_CYCCNT);
|
||||
}
|
||||
|
||||
void up_perf_convert(uint32_t elapsed, FAR struct timespec *ts)
|
||||
void up_perf_convert(uint32_t elapsed, struct timespec *ts)
|
||||
{
|
||||
uint32_t left;
|
||||
|
||||
|
@ -128,7 +128,7 @@ void arm_ramvec_initialize(void)
|
||||
* protect against NULL pointer references.
|
||||
*/
|
||||
|
||||
src = (const CODE up_vector_t *)getreg32(NVIC_VECTAB);
|
||||
src = (const up_vector_t *)getreg32(NVIC_VECTAB);
|
||||
dest = g_ram_vectors;
|
||||
|
||||
irqinfo("src=%p dest=%p\n", src, dest);
|
||||
|
@ -124,7 +124,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* And make sure that the saved context in the TCB is the same
|
||||
* as the interrupt return context.
|
||||
@ -137,10 +137,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -177,7 +177,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* by the signal trampoline after the signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -188,7 +188,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
@ -285,7 +285,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -296,7 +296,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs,
|
||||
@ -331,7 +331,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* And make sure that the saved context in the TCB is the
|
||||
* same as the interrupt return context.
|
||||
@ -344,10 +344,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* been delivered.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = (FAR void *)
|
||||
CURRENT_REGS = (void *)
|
||||
((uint32_t)CURRENT_REGS -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy((FAR uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
memcpy((uint32_t *)CURRENT_REGS, tcb->xcp.saved_regs,
|
||||
XCPTCONTEXT_SIZE);
|
||||
|
||||
CURRENT_REGS[REG_SP] = (uint32_t)CURRENT_REGS +
|
||||
@ -409,7 +409,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* by the signal trampoline after the signal has been delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.sigdeliver = (FAR void *)sigdeliver;
|
||||
tcb->xcp.sigdeliver = (void *)sigdeliver;
|
||||
|
||||
/* Save the current register context location */
|
||||
|
||||
@ -420,7 +420,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* delivered.
|
||||
*/
|
||||
|
||||
tcb->xcp.regs = (FAR void *)
|
||||
tcb->xcp.regs = (void *)
|
||||
((uint32_t)tcb->xcp.regs -
|
||||
(uint32_t)XCPTCONTEXT_SIZE);
|
||||
memcpy(tcb->xcp.regs, tcb->xcp.saved_regs, XCPTCONTEXT_SIZE);
|
||||
|
@ -103,7 +103,7 @@ bool weak_function arm_should_generate_nonsecure_busfault(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_securefault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_securefault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t sfsr = getreg32(SAU_SFSR);
|
||||
|
||||
|
@ -121,7 +121,7 @@ static void dispatch_syscall(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_svcall(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t *regs = (uint32_t *)context;
|
||||
uint32_t cmd;
|
||||
@ -281,7 +281,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
|
||||
/* R0=SYS_task_start: This a user task start
|
||||
*
|
||||
* void up_task_start(main_t taskentry, int argc, FAR char *argv[])
|
||||
* void up_task_start(main_t taskentry, int argc, char *argv[])
|
||||
* noreturn_function;
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
@ -348,7 +348,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
/* R0=SYS_signal_handler: This a user signal handler callback
|
||||
*
|
||||
* void signal_handler(_sa_sigaction_t sighand, int signo,
|
||||
* FAR siginfo_t *info, FAR void *ucontext);
|
||||
* siginfo_t *info, void *ucontext);
|
||||
*
|
||||
* At this point, the following values are saved in context:
|
||||
*
|
||||
@ -421,7 +421,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_LIB_SYSCALL
|
||||
FAR struct tcb_s *rtcb = nxsched_self();
|
||||
struct tcb_s *rtcb = nxsched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
|
@ -57,15 +57,15 @@ struct systick_lowerhalf_s
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static int systick_start(FAR struct timer_lowerhalf_s *lower_);
|
||||
static int systick_stop(FAR struct timer_lowerhalf_s *lower_);
|
||||
static int systick_getstatus(FAR struct timer_lowerhalf_s *lower_,
|
||||
FAR struct timer_status_s *status);
|
||||
static int systick_settimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static int systick_start(struct timer_lowerhalf_s *lower_);
|
||||
static int systick_stop(struct timer_lowerhalf_s *lower_);
|
||||
static int systick_getstatus(struct timer_lowerhalf_s *lower_,
|
||||
struct timer_status_s *status);
|
||||
static int systick_settimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t timeout);
|
||||
static void systick_setcallback(FAR struct timer_lowerhalf_s *lower_,
|
||||
tccb_t callback, FAR void *arg);
|
||||
static int systick_maxtimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static void systick_setcallback(struct timer_lowerhalf_s *lower_,
|
||||
tccb_t callback, void *arg);
|
||||
static int systick_maxtimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t *maxtimeout);
|
||||
|
||||
/****************************************************************************
|
||||
@ -118,21 +118,21 @@ static bool systick_irq_pending(struct systick_lowerhalf_s *lower)
|
||||
}
|
||||
}
|
||||
|
||||
static int systick_start(FAR struct timer_lowerhalf_s *lower_)
|
||||
static int systick_start(struct timer_lowerhalf_s *lower_)
|
||||
{
|
||||
putreg32(0, NVIC_SYSTICK_CURRENT);
|
||||
modifyreg32(NVIC_SYSTICK_CTRL, 0, NVIC_SYSTICK_CTRL_ENABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_stop(FAR struct timer_lowerhalf_s *lower_)
|
||||
static int systick_stop(struct timer_lowerhalf_s *lower_)
|
||||
{
|
||||
modifyreg32(NVIC_SYSTICK_CTRL, NVIC_SYSTICK_CTRL_ENABLE, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_getstatus(FAR struct timer_lowerhalf_s *lower_,
|
||||
FAR struct timer_status_s *status)
|
||||
static int systick_getstatus(struct timer_lowerhalf_s *lower_,
|
||||
struct timer_status_s *status)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = (struct systick_lowerhalf_s *)lower_;
|
||||
irqstate_t flags = enter_critical_section();
|
||||
@ -165,7 +165,7 @@ static int systick_getstatus(FAR struct timer_lowerhalf_s *lower_,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_settimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static int systick_settimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t timeout)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = (struct systick_lowerhalf_s *)lower_;
|
||||
@ -198,8 +198,8 @@ static int systick_settimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void systick_setcallback(FAR struct timer_lowerhalf_s *lower_,
|
||||
CODE tccb_t callback, FAR void *arg)
|
||||
static void systick_setcallback(struct timer_lowerhalf_s *lower_,
|
||||
tccb_t callback, void *arg)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = (struct systick_lowerhalf_s *)lower_;
|
||||
|
||||
@ -209,7 +209,7 @@ static void systick_setcallback(FAR struct timer_lowerhalf_s *lower_,
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
|
||||
static int systick_maxtimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
static int systick_maxtimeout(struct timer_lowerhalf_s *lower_,
|
||||
uint32_t *maxtimeout)
|
||||
{
|
||||
uint64_t maxtimeout64 = usec_from_count(
|
||||
@ -227,7 +227,7 @@ static int systick_maxtimeout(FAR struct timer_lowerhalf_s *lower_,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int systick_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int systick_interrupt(int irq, void *context, void *arg)
|
||||
{
|
||||
struct systick_lowerhalf_s *lower = arg;
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arm_usagefault(int irq, FAR void *context, FAR void *arg)
|
||||
int arm_usagefault(int irq, void *context, void *arg)
|
||||
{
|
||||
uint32_t cfsr = getreg32(NVIC_CFAULTS);
|
||||
|
||||
|
@ -103,9 +103,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_allocate_kheap(void **heap_start, size_t *heap_size)
|
||||
#else
|
||||
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||
#endif
|
||||
{
|
||||
#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_MM_KERNEL_HEAP)
|
||||
@ -123,14 +123,14 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
/* Return the user-space heap settings */
|
||||
|
||||
board_autoled_on(LED_HEAPALLOCATE);
|
||||
*heap_start = (FAR void *)ubase;
|
||||
*heap_start = (void *)ubase;
|
||||
*heap_size = usize;
|
||||
#else
|
||||
|
||||
/* Return the heap settings */
|
||||
|
||||
board_autoled_on(LED_HEAPALLOCATE);
|
||||
*heap_start = (FAR void *)g_idle_topstack;
|
||||
*heap_start = (void *)g_idle_topstack;
|
||||
*heap_size = CONFIG_RAM_END - g_idle_topstack;
|
||||
#endif
|
||||
}
|
||||
@ -147,7 +147,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_MM_KERNEL_HEAP)
|
||||
void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_allocate_kheap(void **heap_start, size_t *heap_size)
|
||||
{
|
||||
/* Get the unaligned size and position of the user-space heap.
|
||||
* This heap begins after the user-space .bss section at an offset
|
||||
@ -162,7 +162,7 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
|
||||
* that was not dedicated to the user heap).
|
||||
*/
|
||||
|
||||
*heap_start = (FAR void *)USERSPACE->us_bssend;
|
||||
*heap_start = (void *)USERSPACE->us_bssend;
|
||||
*heap_size = ubase - (uintptr_t)USERSPACE->us_bssend;
|
||||
}
|
||||
#endif
|
||||
|
@ -86,7 +86,7 @@ static void arm_stackdump(uint32_t sp, uint32_t stack_top)
|
||||
* Name: arm_registerdump
|
||||
****************************************************************************/
|
||||
|
||||
static void arm_registerdump(FAR volatile uint32_t *regs)
|
||||
static void arm_registerdump(volatile uint32_t *regs)
|
||||
{
|
||||
/* Dump the interrupt registers */
|
||||
|
||||
@ -125,7 +125,7 @@ static void arm_registerdump(FAR volatile uint32_t *regs)
|
||||
* Name: arm_dump_task
|
||||
****************************************************************************/
|
||||
|
||||
static void arm_dump_task(FAR struct tcb_s *tcb, FAR void *arg)
|
||||
static void arm_dump_task(struct tcb_s *tcb, void *arg)
|
||||
{
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
uint32_t stack_filled = 0;
|
||||
@ -208,7 +208,7 @@ static void arm_dump_task(FAR struct tcb_s *tcb, FAR void *arg)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SCHED_BACKTRACE
|
||||
static void arm_dump_backtrace(FAR struct tcb_s *tcb, FAR void *arg)
|
||||
static void arm_dump_backtrace(struct tcb_s *tcb, void *arg)
|
||||
{
|
||||
/* Show back trace */
|
||||
|
||||
@ -299,7 +299,7 @@ static void arm_showtasks(void)
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_USBDUMP
|
||||
static int usbtrace_syslog(FAR const char *fmt, ...)
|
||||
static int usbtrace_syslog(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@ -311,7 +311,7 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
|
||||
static int assert_tracecallback(struct usbtrace_s *trace, void *arg)
|
||||
{
|
||||
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
|
||||
return 0;
|
||||
@ -353,7 +353,7 @@ static void arm_dump_stack(const char *tag, uint32_t sp,
|
||||
|
||||
static void arm_dumpstate(void)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = running_task();
|
||||
struct tcb_s *rtcb = running_task();
|
||||
uint32_t sp = up_getsp();
|
||||
|
||||
/* Show back trace */
|
||||
@ -367,7 +367,7 @@ static void arm_dumpstate(void)
|
||||
if (CURRENT_REGS)
|
||||
{
|
||||
memcpy(rtcb->xcp.regs,
|
||||
(FAR uintptr_t *)CURRENT_REGS, XCPTCONTEXT_SIZE);
|
||||
(uintptr_t *)CURRENT_REGS, XCPTCONTEXT_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -46,9 +46,9 @@
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
static int backtrace(FAR uintptr_t *base, FAR uintptr_t *limit,
|
||||
FAR uintptr_t *fp, FAR uintptr_t *pc,
|
||||
FAR void **buffer, int size, FAR int *skip)
|
||||
static int backtrace(uintptr_t *base, uintptr_t *limit,
|
||||
uintptr_t *fp, uintptr_t *pc,
|
||||
void **buffer, int size, int *skip)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -61,7 +61,7 @@ static int backtrace(FAR uintptr_t *base, FAR uintptr_t *limit,
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < size; fp = (FAR uintptr_t *)*(fp - 1), i++)
|
||||
for (; i < size; fp = (uintptr_t *)*(fp - 1), i++)
|
||||
{
|
||||
if (fp > limit || fp < base || *fp == 0)
|
||||
{
|
||||
@ -70,7 +70,7 @@ static int backtrace(FAR uintptr_t *base, FAR uintptr_t *limit,
|
||||
|
||||
if (*skip-- <= 0)
|
||||
{
|
||||
*buffer++ = (FAR void *)*fp;
|
||||
*buffer++ = (void *)*fp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,12 +109,12 @@ static int backtrace(FAR uintptr_t *base, FAR uintptr_t *limit,
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
int up_backtrace(FAR struct tcb_s *tcb,
|
||||
FAR void **buffer, int size, int skip)
|
||||
int up_backtrace(struct tcb_s *tcb,
|
||||
void **buffer, int size, int skip)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = running_task();
|
||||
struct tcb_s *rtcb = running_task();
|
||||
#if CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||
FAR void *istacklimit;
|
||||
void *istacklimit;
|
||||
#endif
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
@ -136,20 +136,20 @@ int up_backtrace(FAR struct tcb_s *tcb,
|
||||
# endif /* CONFIG_SMP */
|
||||
ret = backtrace(istacklimit - (CONFIG_ARCH_INTERRUPTSTACK & ~7),
|
||||
istacklimit,
|
||||
(FAR void *)__builtin_frame_address(0),
|
||||
(void *)__builtin_frame_address(0),
|
||||
NULL, buffer, size, &skip);
|
||||
#else
|
||||
ret = backtrace(rtcb->stack_base_ptr,
|
||||
rtcb->stack_base_ptr + rtcb->adj_stack_size,
|
||||
(FAR void *)__builtin_frame_address(0),
|
||||
(void *)__builtin_frame_address(0),
|
||||
NULL, buffer, size, &skip);
|
||||
#endif /* CONFIG_ARCH_INTERRUPTSTACK > 7 */
|
||||
if (ret < size)
|
||||
{
|
||||
ret += backtrace(rtcb->stack_base_ptr,
|
||||
rtcb->stack_base_ptr + rtcb->adj_stack_size,
|
||||
(FAR void *)CURRENT_REGS[REG_FP],
|
||||
(FAR void *)CURRENT_REGS[REG_PC],
|
||||
(void *)CURRENT_REGS[REG_FP],
|
||||
(void *)CURRENT_REGS[REG_PC],
|
||||
&buffer[ret], size - ret, &skip);
|
||||
}
|
||||
}
|
||||
@ -157,7 +157,7 @@ int up_backtrace(FAR struct tcb_s *tcb,
|
||||
{
|
||||
ret = backtrace(rtcb->stack_base_ptr,
|
||||
rtcb->stack_base_ptr + rtcb->adj_stack_size,
|
||||
(FAR void *)__builtin_frame_address(0),
|
||||
(void *)__builtin_frame_address(0),
|
||||
NULL, buffer, size, &skip);
|
||||
}
|
||||
}
|
||||
@ -167,8 +167,8 @@ int up_backtrace(FAR struct tcb_s *tcb,
|
||||
|
||||
ret = backtrace(tcb->stack_base_ptr,
|
||||
tcb->stack_base_ptr + tcb->adj_stack_size,
|
||||
(FAR void *)tcb->xcp.regs[REG_FP],
|
||||
(FAR void *)tcb->xcp.regs[REG_PC],
|
||||
(void *)tcb->xcp.regs[REG_FP],
|
||||
(void *)tcb->xcp.regs[REG_PC],
|
||||
buffer, size, &skip);
|
||||
|
||||
leave_critical_section(flags);
|
||||
|
@ -79,7 +79,7 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static FAR void **g_backtrace_code_regions;
|
||||
static void **g_backtrace_code_regions;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@ -102,16 +102,16 @@ static FAR void **g_backtrace_code_regions;
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
static int getlroffset(FAR uint8_t *lr)
|
||||
static int getlroffset(uint8_t *lr)
|
||||
{
|
||||
lr = (FAR uint8_t *)((uintptr_t)lr & 0xfffffffe);
|
||||
lr = (uint8_t *)((uintptr_t)lr & 0xfffffffe);
|
||||
|
||||
if (((uintptr_t)lr & 0xffffffe0) == 0xffffffe0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (*(FAR uint16_t *)(lr - 4) & 0xf000) == 0xf000 ? 5 : 3;
|
||||
return (*(uint16_t *)(lr - 4) & 0xf000) == 0xf000 ? 5 : 3;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -133,7 +133,7 @@ static int getlroffset(FAR uint8_t *lr)
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
static bool in_code_region(FAR void *pc)
|
||||
static bool in_code_region(void *pc)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -184,13 +184,12 @@ static bool in_code_region(FAR void *pc)
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
FAR void **ppc)
|
||||
static void *backtrace_push_internal(void **psp, void **ppc)
|
||||
{
|
||||
FAR uint8_t *sp = *psp;
|
||||
FAR uint8_t *pc = *ppc;
|
||||
FAR uint8_t *base;
|
||||
FAR uint8_t *lr;
|
||||
uint8_t *sp = *psp;
|
||||
uint8_t *pc = *ppc;
|
||||
uint8_t *base;
|
||||
uint8_t *lr;
|
||||
uint32_t ins32;
|
||||
uint16_t ins16;
|
||||
int offset = 1;
|
||||
@ -199,11 +198,11 @@ static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
|
||||
for (i = 0; i < INSTR_LIMIT; i += 2)
|
||||
{
|
||||
ins16 = *(FAR uint16_t *)(pc - i);
|
||||
ins16 = *(uint16_t *)(pc - i);
|
||||
if (INSTR_IS(ins16, T_PUSH))
|
||||
{
|
||||
frame = __builtin_popcount(ins16 & 0xff) + 1;
|
||||
ins16 = *(FAR uint16_t *)(pc - i - 2);
|
||||
ins16 = *(uint16_t *)(pc - i - 2);
|
||||
if (INSTR_IS(ins16, T_PUSH_LO))
|
||||
{
|
||||
offset += __builtin_popcount(ins16 & 0xff);
|
||||
@ -214,11 +213,11 @@ static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
}
|
||||
|
||||
ins32 = ins16 << 16;
|
||||
ins32 |= *(FAR uint16_t *)(pc - i + 2);
|
||||
ins32 |= *(uint16_t *)(pc - i + 2);
|
||||
if (INSTR_IS(ins32, T_STMDB))
|
||||
{
|
||||
frame = __builtin_popcount(ins32 & 0xfff) + 1;
|
||||
ins16 = *(FAR uint16_t *)(pc - i - 2);
|
||||
ins16 = *(uint16_t *)(pc - i - 2);
|
||||
if (INSTR_IS(ins16, T_PUSH_LO))
|
||||
{
|
||||
offset += __builtin_popcount(ins16 & 0xff);
|
||||
@ -238,7 +237,7 @@ static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
|
||||
for (i = 0; i < INSTR_LIMIT && base + i < pc; )
|
||||
{
|
||||
ins16 = *(FAR uint16_t *)(base + i);
|
||||
ins16 = *(uint16_t *)(base + i);
|
||||
if (INSTR_IS(ins16, T_SUB_SP_16))
|
||||
{
|
||||
frame += (ins16 & 0x7f);
|
||||
@ -246,7 +245,7 @@ static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
}
|
||||
|
||||
ins32 = ins16 << 16;
|
||||
ins32 |= *(FAR uint16_t *)(base + i + 2);
|
||||
ins32 |= *(uint16_t *)(base + i + 2);
|
||||
if (INSTR_IS(ins32, T_SUB_SP_32))
|
||||
{
|
||||
uint32_t shift = ins32 >> 24 & 0x4;
|
||||
@ -286,7 +285,7 @@ static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
i += ((ins16 & 0xf800) >= 0xe800) ? 4 : 2;
|
||||
}
|
||||
|
||||
lr = (FAR uint8_t *)*((FAR uint32_t *)sp + frame - offset);
|
||||
lr = (uint8_t *)*((uint32_t *)sp + frame - offset);
|
||||
if (!in_code_region(lr))
|
||||
{
|
||||
return NULL;
|
||||
@ -298,7 +297,7 @@ static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*psp = (FAR uint32_t *)sp + frame;
|
||||
*psp = (uint32_t *)sp + frame;
|
||||
*ppc = lr - offset;
|
||||
|
||||
return *ppc;
|
||||
@ -315,8 +314,8 @@ static FAR void *backtrace_push_internal(FAR void **psp,
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
static int backtrace_push(FAR void *limit, FAR void **sp, FAR void *pc,
|
||||
FAR void **buffer, int size, FAR int *skip)
|
||||
static int backtrace_push(void *limit, void **sp, void *pc,
|
||||
void **buffer, int size, int *skip)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@ -325,7 +324,7 @@ static int backtrace_push(FAR void *limit, FAR void **sp, FAR void *pc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
pc = (FAR void *)((uintptr_t)pc & 0xfffffffe);
|
||||
pc = (void *)((uintptr_t)pc & 0xfffffffe);
|
||||
|
||||
if ((*skip)-- <= 0)
|
||||
{
|
||||
@ -365,8 +364,8 @@ static int backtrace_push(FAR void *limit, FAR void **sp, FAR void *pc,
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
static int backtrace_branch(FAR void *limit, FAR void *sp,
|
||||
FAR void **buffer, int size, FAR int *skip)
|
||||
static int backtrace_branch(void *limit, void *sp,
|
||||
void **buffer, int size, int *skip)
|
||||
{
|
||||
uint16_t ins16;
|
||||
uint32_t addr;
|
||||
@ -374,19 +373,19 @@ static int backtrace_branch(FAR void *limit, FAR void *sp,
|
||||
|
||||
for (i = 0; i < size && sp < limit; sp += sizeof(uint32_t))
|
||||
{
|
||||
addr = *(FAR uint32_t *)sp;
|
||||
if (!in_code_region((FAR void *)addr))
|
||||
addr = *(uint32_t *)sp;
|
||||
if (!in_code_region((void *)addr))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
addr = (addr & ~1) - 2;
|
||||
ins16 = *(FAR uint16_t *)addr;
|
||||
ins16 = *(uint16_t *)addr;
|
||||
if (INSTR_IS(ins16, T_BLX))
|
||||
{
|
||||
if ((*skip)-- <= 0)
|
||||
{
|
||||
buffer[i++] = (FAR void *)addr;
|
||||
buffer[i++] = (void *)addr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,12 +399,12 @@ static int backtrace_branch(FAR void *limit, FAR void *sp,
|
||||
else if ((ins16 & 0xd000) == 0xd000)
|
||||
{
|
||||
addr -= 2;
|
||||
ins16 = *(FAR uint16_t *)addr;
|
||||
ins16 = *(uint16_t *)addr;
|
||||
if (INSTR_IS(ins16, T_BL))
|
||||
{
|
||||
if ((*skip)-- <= 0)
|
||||
{
|
||||
buffer[i++] = (FAR void *)addr;
|
||||
buffer[i++] = (void *)addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -449,7 +448,7 @@ static int backtrace_branch(FAR void *limit, FAR void *sp,
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
void up_backtrace_init_code_regions(FAR void **regions)
|
||||
void up_backtrace_init_code_regions(void **regions)
|
||||
{
|
||||
g_backtrace_code_regions = regions;
|
||||
}
|
||||
@ -481,12 +480,12 @@ void up_backtrace_init_code_regions(FAR void **regions)
|
||||
#ifdef CONFIG_MM_KASAN
|
||||
__attribute__((no_sanitize_address))
|
||||
#endif
|
||||
int up_backtrace(FAR struct tcb_s *tcb,
|
||||
FAR void **buffer, int size, FAR int skip)
|
||||
int up_backtrace(struct tcb_s *tcb,
|
||||
void **buffer, int size, int skip)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = running_task();
|
||||
struct tcb_s *rtcb = running_task();
|
||||
irqstate_t flags;
|
||||
FAR void *sp;
|
||||
void *sp;
|
||||
int ret;
|
||||
|
||||
if (size <= 0 || !buffer)
|
||||
@ -501,7 +500,7 @@ int up_backtrace(FAR struct tcb_s *tcb,
|
||||
|
||||
if (tcb == rtcb)
|
||||
{
|
||||
sp = (FAR void *)up_getsp();
|
||||
sp = (void *)up_getsp();
|
||||
|
||||
if (up_interrupt_context())
|
||||
{
|
||||
@ -512,20 +511,20 @@ int up_backtrace(FAR struct tcb_s *tcb,
|
||||
# else
|
||||
&g_intstacktop,
|
||||
# endif /* CONFIG_SMP */
|
||||
&sp, (FAR void *)up_backtrace + 10,
|
||||
&sp, (void *)up_backtrace + 10,
|
||||
buffer, size, &skip);
|
||||
#else
|
||||
ret = backtrace_push(rtcb->stack_base_ptr +
|
||||
rtcb->adj_stack_size,
|
||||
&sp, (FAR void *)up_backtrace + 10,
|
||||
&sp, (void *)up_backtrace + 10,
|
||||
buffer, size, &skip);
|
||||
#endif
|
||||
if (ret < size)
|
||||
{
|
||||
sp = (FAR void *)CURRENT_REGS[REG_SP];
|
||||
sp = (void *)CURRENT_REGS[REG_SP];
|
||||
ret += backtrace_push(rtcb->stack_base_ptr +
|
||||
rtcb->adj_stack_size, &sp,
|
||||
(FAR void *)CURRENT_REGS[REG_PC],
|
||||
(void *)CURRENT_REGS[REG_PC],
|
||||
&buffer[ret], size - ret, &skip);
|
||||
}
|
||||
}
|
||||
@ -533,7 +532,7 @@ int up_backtrace(FAR struct tcb_s *tcb,
|
||||
{
|
||||
ret = backtrace_push(rtcb->stack_base_ptr +
|
||||
rtcb->adj_stack_size, &sp,
|
||||
(FAR void *)up_backtrace + 10,
|
||||
(void *)up_backtrace + 10,
|
||||
buffer, size, &skip);
|
||||
}
|
||||
|
||||
@ -550,14 +549,14 @@ int up_backtrace(FAR struct tcb_s *tcb,
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
buffer[ret++] = (FAR void *)tcb->xcp.regs[REG_PC];
|
||||
buffer[ret++] = (void *)tcb->xcp.regs[REG_PC];
|
||||
|
||||
if (ret < size)
|
||||
{
|
||||
sp = (FAR void *)tcb->xcp.regs[REG_SP];
|
||||
sp = (void *)tcb->xcp.regs[REG_SP];
|
||||
ret += backtrace_push(tcb->stack_base_ptr +
|
||||
tcb->adj_stack_size, &sp,
|
||||
(FAR void *)tcb->xcp.regs[REG_LR],
|
||||
(void *)tcb->xcp.regs[REG_LR],
|
||||
&buffer[ret], size - ret, &skip);
|
||||
|
||||
if (ret < size)
|
||||
|
@ -59,11 +59,11 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
static size_t do_stackcheck(void *stackbase, size_t nbytes)
|
||||
{
|
||||
uintptr_t start;
|
||||
uintptr_t end;
|
||||
FAR uint32_t *ptr;
|
||||
uint32_t *ptr;
|
||||
size_t mark;
|
||||
|
||||
if (nbytes == 0)
|
||||
@ -86,7 +86,7 @@ static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
* that does not have the magic value is the high water mark.
|
||||
*/
|
||||
|
||||
for (ptr = (FAR uint32_t *)start, mark = (nbytes >> 2);
|
||||
for (ptr = (uint32_t *)start, mark = (nbytes >> 2);
|
||||
*ptr == STACK_COLOR && mark > 0;
|
||||
ptr++, mark--);
|
||||
|
||||
@ -106,7 +106,7 @@ static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
int i;
|
||||
int j;
|
||||
|
||||
ptr = (FAR uint32_t *)start;
|
||||
ptr = (uint32_t *)start;
|
||||
for (i = 0; i < nbytes; i += 4 * 64)
|
||||
{
|
||||
for (j = 0; j < 64; j++)
|
||||
@ -146,7 +146,7 @@ static size_t do_stackcheck(FAR void *stackbase, size_t nbytes)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arm_stack_color(FAR void *stackbase, size_t nbytes)
|
||||
void arm_stack_color(void *stackbase, size_t nbytes)
|
||||
{
|
||||
uint32_t *stkptr;
|
||||
uintptr_t stkend;
|
||||
@ -197,12 +197,12 @@ void arm_stack_color(FAR void *stackbase, size_t nbytes)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
size_t up_check_tcbstack(FAR struct tcb_s *tcb)
|
||||
size_t up_check_tcbstack(struct tcb_s *tcb)
|
||||
{
|
||||
return do_stackcheck(tcb->stack_base_ptr, tcb->adj_stack_size);
|
||||
}
|
||||
|
||||
ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb)
|
||||
ssize_t up_check_tcbstack_remain(struct tcb_s *tcb)
|
||||
{
|
||||
return tcb->adj_stack_size - up_check_tcbstack(tcb);
|
||||
}
|
||||
@ -221,10 +221,10 @@ ssize_t up_check_stack_remain(void)
|
||||
size_t up_check_intstack(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
return do_stackcheck((FAR void *)arm_intstack_alloc(),
|
||||
return do_stackcheck((void *)arm_intstack_alloc(),
|
||||
STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK));
|
||||
#else
|
||||
return do_stackcheck((FAR void *)&g_intstackalloc,
|
||||
return do_stackcheck((void *)&g_intstackalloc,
|
||||
STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK));
|
||||
#endif
|
||||
}
|
||||
|
@ -81,7 +81,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||
int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
|
||||
{
|
||||
#ifdef CONFIG_TLS_ALIGNED
|
||||
/* The allocated stack size must not exceed the maximum possible for the
|
||||
|
@ -62,9 +62,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DUMP_ON_EXIT
|
||||
static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg)
|
||||
static void _up_dumponexit(struct tcb_s *tcb, void *arg)
|
||||
{
|
||||
FAR struct filelist *filelist;
|
||||
struct filelist *filelist;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
@ -107,9 +107,9 @@
|
||||
|
||||
# if defined(CONFIG_ARCH_FPU) && (defined(CONFIG_ARMV7M_LAZYFPU) || \
|
||||
defined(CONFIG_ARMV8M_LAZYFPU))
|
||||
# define arm_savestate(regs) (regs = (FAR uint32_t *)CURRENT_REGS, arm_savefpu(regs))
|
||||
# define arm_savestate(regs) (regs = (uint32_t *)CURRENT_REGS, arm_savefpu(regs))
|
||||
# else
|
||||
# define arm_savestate(regs) (regs = (FAR uint32_t *)CURRENT_REGS)
|
||||
# define arm_savestate(regs) (regs = (uint32_t *)CURRENT_REGS)
|
||||
# endif
|
||||
# define arm_restorestate(regs) (CURRENT_REGS = regs)
|
||||
|
||||
@ -124,9 +124,9 @@
|
||||
*/
|
||||
|
||||
# if defined(CONFIG_ARCH_FPU)
|
||||
# define arm_savestate(regs) (regs = (FAR uint32_t *)CURRENT_REGS, arm_savefpu(regs))
|
||||
# define arm_savestate(regs) (regs = (uint32_t *)CURRENT_REGS, arm_savefpu(regs))
|
||||
# else
|
||||
# define arm_savestate(regs) (regs = (FAR uint32_t *)CURRENT_REGS)
|
||||
# define arm_savestate(regs) (regs = (uint32_t *)CURRENT_REGS)
|
||||
# endif
|
||||
# define arm_restorestate(regs) (CURRENT_REGS = regs)
|
||||
|
||||
@ -143,9 +143,9 @@
|
||||
*/
|
||||
|
||||
# if defined(CONFIG_ARCH_FPU)
|
||||
# define arm_savestate(regs) (regs = (FAR uint32_t *)CURRENT_REGS, arm_savefpu(regs))
|
||||
# define arm_savestate(regs) (regs = (uint32_t *)CURRENT_REGS, arm_savefpu(regs))
|
||||
# else
|
||||
# define arm_savestate(regs) (regs = (FAR uint32_t *)CURRENT_REGS)
|
||||
# define arm_savestate(regs) (regs = (uint32_t *)CURRENT_REGS)
|
||||
# endif
|
||||
# define arm_restorestate(regs) (CURRENT_REGS = regs)
|
||||
|
||||
@ -362,15 +362,15 @@ uint32_t *arm_doirq(int irq, uint32_t *regs);
|
||||
|
||||
/* Exception Handlers */
|
||||
|
||||
int arm_svcall(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_hardfault(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_svcall(int irq, void *context, void *arg);
|
||||
int arm_hardfault(int irq, void *context, void *arg);
|
||||
|
||||
# if defined(CONFIG_ARCH_ARMV7M) || defined(CONFIG_ARCH_ARMV8M)
|
||||
|
||||
int arm_memfault(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_busfault(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_usagefault(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_securefault(int irq, FAR void *context, FAR void *arg);
|
||||
int arm_memfault(int irq, void *context, void *arg);
|
||||
int arm_busfault(int irq, void *context, void *arg);
|
||||
int arm_usagefault(int irq, void *context, void *arg);
|
||||
int arm_securefault(int irq, void *context, void *arg);
|
||||
|
||||
# endif /* CONFIG_ARCH_CORTEXM3,4,7 */
|
||||
|
||||
@ -514,7 +514,7 @@ void arm_usbuninitialize(void);
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
void arm_stack_color(FAR void *stackbase, size_t nbytes);
|
||||
void arm_stack_color(void *stackbase, size_t nbytes);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
@ -67,7 +67,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype)
|
||||
void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
|
||||
{
|
||||
/* Is there a stack allocated? */
|
||||
|
||||
|
@ -61,7 +61,7 @@ int up_putc(int ch)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_puts(FAR const char *str)
|
||||
void up_puts(const char *str)
|
||||
{
|
||||
smh_call(SEMI_SYSLOG_WRITE0, (char *)str);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
void up_signal_dispatch(_sa_sigaction_t sighand, int signo,
|
||||
FAR siginfo_t *info, FAR void *ucontext)
|
||||
siginfo_t *info, void *ucontext)
|
||||
{
|
||||
/* Let sys_call4() do all of the work */
|
||||
|
||||
|
@ -69,9 +69,9 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
||||
void *up_stack_frame(struct tcb_s *tcb, size_t frame_size)
|
||||
{
|
||||
FAR void *ret;
|
||||
void *ret;
|
||||
|
||||
/* Align the frame_size */
|
||||
|
||||
@ -89,7 +89,7 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
|
||||
|
||||
/* Save the adjusted stack values in the struct tcb_s */
|
||||
|
||||
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
|
||||
tcb->stack_base_ptr = (uint8_t *)tcb->stack_base_ptr + frame_size;
|
||||
tcb->adj_stack_size -= frame_size;
|
||||
|
||||
/* And return the pointer to the allocated region */
|
||||
|
@ -62,7 +62,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_task_start(main_t taskentry, int argc, FAR char *argv[])
|
||||
void up_task_start(main_t taskentry, int argc, char *argv[])
|
||||
{
|
||||
/* Let sys_call3() do all of the work */
|
||||
|
||||
|
@ -63,9 +63,9 @@ int up_tls_size(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_tls_initialize(FAR struct tls_info_s *info)
|
||||
void up_tls_initialize(struct tls_info_s *info)
|
||||
{
|
||||
FAR uint8_t *tls_data = (FAR uint8_t *)(info + 1);
|
||||
uint8_t *tls_data = (uint8_t *)(info + 1);
|
||||
|
||||
uint32_t tdata_len = sizeof(uint32_t) * (_END_TDATA - _START_TDATA);
|
||||
uint32_t tbss_len = sizeof(uint32_t) * (_END_TBSS - _START_TBSS);
|
||||
|
Loading…
Reference in New Issue
Block a user