From 2b2bbf6433f7271abce9c3e4cbdf2f456fcbeca3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 17 Mar 2013 16:13:28 +0000 Subject: Add support for nested system calls git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5752 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/include/armv6-m/irq.h | 30 ++++++++++++++++++++++++------ nuttx/arch/arm/include/armv7-m/irq.h | 30 ++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 12 deletions(-) (limited to 'nuttx/arch/arm/include') diff --git a/nuttx/arch/arm/include/armv6-m/irq.h b/nuttx/arch/arm/include/armv6-m/irq.h index 75aed8ff1..f4b026c41 100644 --- a/nuttx/arch/arm/include/armv6-m/irq.h +++ b/nuttx/arch/arm/include/armv6-m/irq.h @@ -57,8 +57,14 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Configuration ************************************************************/ +/* If this is a kernel build, how many nested system calls should we support? */ -/* IRQ Stack Frame Format: +#ifndef CONFIG_SYS_NNEST +# define CONFIG_SYS_NNEST 2 +#endif + +/* IRQ Stack Frame Format *************************************************** * * The following additional registers are stored by the interrupt handling * logic. @@ -140,11 +146,22 @@ * Public Types ****************************************************************************/ +#ifndef __ASSEMBLY__ + +/* This structure represents the return state from a system call */ + +#ifdef CONFIG_NUTTX_KERNEL +struct xcpt_syscall_s +{ + uint32_t excreturn; /* The EXC_RETURN value */ + uint32_t sysreturn; /* The return PC */ +}; +#endif + /* The following structure is included in the TCB and defines the complete * state of the thread. */ -#ifndef __ASSEMBLY__ struct xcptcontext { #ifndef CONFIG_DISABLE_SIGNALS @@ -168,16 +185,17 @@ struct xcptcontext */ uint32_t sigreturn; + # endif #endif #ifdef CONFIG_NUTTX_KERNEL - /* The following holds the return address and the exc_return value needed - * to return from a system call. + /* The following array holds the return address and the exc_return value + * needed to return from each nested system call. */ - uint32_t excreturn; - uint32_t sysreturn; + uint8_t nsyscalls; + struct xcpt_syscall_s syscall[CONFIG_SYS_NNEST]; #endif /* Register save area */ diff --git a/nuttx/arch/arm/include/armv7-m/irq.h b/nuttx/arch/arm/include/armv7-m/irq.h index afeebdb4f..663a703e3 100644 --- a/nuttx/arch/arm/include/armv7-m/irq.h +++ b/nuttx/arch/arm/include/armv7-m/irq.h @@ -67,8 +67,14 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Configuration ************************************************************/ +/* If this is a kernel build, how many nested system calls should we support? */ -/* Alternate register names */ +#ifndef CONFIG_SYS_NNEST +# define CONFIG_SYS_NNEST 2 +#endif + +/* Alternate register names *************************************************/ #define REG_A1 REG_R0 #define REG_A2 REG_R1 @@ -98,12 +104,22 @@ /**************************************************************************** * Public Types ****************************************************************************/ +#ifndef __ASSEMBLY__ + +/* This structure represents the return state from a system call */ + +#ifdef CONFIG_NUTTX_KERNEL +struct xcpt_syscall_s +{ + uint32_t excreturn; /* The EXC_RETURN value */ + uint32_t sysreturn; /* The return PC */ +}; +#endif /* The following structure is included in the TCB and defines the complete * state of the thread. */ -#ifndef __ASSEMBLY__ struct xcptcontext { #ifndef CONFIG_DISABLE_SIGNALS @@ -131,16 +147,18 @@ struct xcptcontext */ uint32_t sigreturn; + # endif #endif #ifdef CONFIG_NUTTX_KERNEL - /* The following holds the return address and the exc_return value needed - * to return from a system call. + /* The following array holds the return address and the exc_return value + * needed to return from each nested system call. */ - uint32_t excreturn; - uint32_t sysreturn; + uint8_t nsyscalls; + struct xcpt_syscall_s syscall[CONFIG_SYS_NNEST]; + #endif /* Register save area */ -- cgit v1.2.3