From 373363d750808dff11370a03e855ea427a2c6ffa Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 18 Apr 2022 01:53:32 +0800 Subject: [PATCH] arch/arm: Move arm_signal_dispatch.c to common folder Signed-off-by: Xiang Xiao --- arch/arm/src/armv6-m/arm_signal_dispatch.c | 76 --------------- arch/arm/src/armv7-a/arm_signal_dispatch.c | 92 ------------------- arch/arm/src/armv7-r/arm_signal_dispatch.c | 92 ------------------- arch/arm/src/armv8-m/arm_signal_dispatch.c | 76 --------------- .../{armv7-m => common}/arm_signal_dispatch.c | 4 +- 5 files changed, 2 insertions(+), 338 deletions(-) delete mode 100644 arch/arm/src/armv6-m/arm_signal_dispatch.c delete mode 100644 arch/arm/src/armv7-a/arm_signal_dispatch.c delete mode 100644 arch/arm/src/armv7-r/arm_signal_dispatch.c delete mode 100644 arch/arm/src/armv8-m/arm_signal_dispatch.c rename arch/arm/src/{armv7-m => common}/arm_signal_dispatch.c (96%) diff --git a/arch/arm/src/armv6-m/arm_signal_dispatch.c b/arch/arm/src/armv6-m/arm_signal_dispatch.c deleted file mode 100644 index 932a812d05e..00000000000 --- a/arch/arm/src/armv6-m/arm_signal_dispatch.c +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** - * arch/arm/src/armv6-m/arm_signal_dispatch.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include - -#include "arm_internal.h" - -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_signal_dispatch - * - * Description: - * In this kernel mode build, this function will be called to execute a - * a signal handler in user-space. When the signal is delivered, a - * kernel-mode stub will first run to perform some housekeeping functions. - * This kernel-mode stub will then be called transfer control to the user - * mode signal handler by calling this function. - * - * Normally the user-mode signalling handling stub will also execute - * before the ultimate signal handler is called. See - * arch/arm/src/armv6-m/arm_signal_handler.S. This function is the - * user-space, signal handler trampoline function. It is called from - * up_signal_dispatch() in user-mode. - * - * Input Parameters: - * sighand - The address user-space signal handling function - * signo, info, and ucontext - Standard arguments to be passed to the - * signal handling function. - * - * Returned Value: - * None. This function does not return in the normal sense. It returns - * via an architecture specific system call made by up_signal_handler(). - * However, this will look like a normal return by the caller of - * up_signal_dispatch. - * - ****************************************************************************/ - -void up_signal_dispatch(_sa_sigaction_t sighand, int signo, - FAR siginfo_t *info, FAR void *ucontext) -{ - /* Let sys_call4() do all of the work */ - - sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); -} - -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ diff --git a/arch/arm/src/armv7-a/arm_signal_dispatch.c b/arch/arm/src/armv7-a/arm_signal_dispatch.c deleted file mode 100644 index 8a94b46f757..00000000000 --- a/arch/arm/src/armv7-a/arm_signal_dispatch.c +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * arch/arm/src/armv7-a/arm_signal_dispatch.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include - -#include "pgalloc.h" -#include "arm_internal.h" - -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_signal_dispatch - * - * Description: - * In this kernel mode build, this function will be called to execute a - * a signal handler in user-space. When the signal is delivered, a - * kernel-mode stub will first run to perform some housekeeping functions. - * This kernel-mode stub will then be called transfer control to the user - * mode signal handler by calling this function. - * - * Normally the user-mode signalling handling stub will also execute - * before the ultimate signal handler is called. See - * arch/arm/src/armv7-a/crt0.c. This function is the - * user-space, signal handler trampoline function. It is called from - * up_signal_dispatch() in user-mode. - * - * Input Parameters: - * sighand - The address user-space signal handling function - * signo, info, and ucontext - Standard arguments to be passed to the - * signal handling function. - * - * Returned Value: - * None. This function does not return in the normal sense. It returns - * via an architecture specific system call made by up_signal_handler(). - * However, this will look like a normal return by the caller of - * up_signal_dispatch. - * - ****************************************************************************/ - -void up_signal_dispatch(_sa_sigaction_t sighand, int signo, - FAR siginfo_t *info, FAR void *ucontext) -{ - /* We are signalling a user group, but does the signal handler lie in the - * user address space? Or the kernel address space? The OS does - * intercept some signals for its own purpose (such as the death-of-child - * signal. - */ - - if (arm_uservaddr((uintptr_t)sighand)) - { - /* Yes.. Let sys_call4() do all of the work to get us into user space */ - - sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); - } - else - { - /* No.. we are already in kernel mode so just call the handler */ - - sighand(signo, info, ucontext); - } -} - -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ diff --git a/arch/arm/src/armv7-r/arm_signal_dispatch.c b/arch/arm/src/armv7-r/arm_signal_dispatch.c deleted file mode 100644 index a229d42851c..00000000000 --- a/arch/arm/src/armv7-r/arm_signal_dispatch.c +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * arch/arm/src/armv7-r/arm_signal_dispatch.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include - -#include "pgalloc.h" -#include "arm_internal.h" - -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_signal_dispatch - * - * Description: - * In the protected mode build, this function will be called to execute a - * a signal handler in user-space. When the signal is delivered, a - * kernel-mode stub will first run to perform some housekeeping functions. - * This kernel-mode stub will then be called transfer control to the user - * mode signal handler by calling this function. - * - * Normally the a user-mode signalling handling stub will also execute - * before the ultimate signal handler is called. See - * arch/arm/src/armv[6\7]/up_signal_handler. This function is the - * user-space, signal handler trampoline function. It is called from - * up_signal_dispatch() in user-mode. - * - * Input Parameters: - * sighand - The address user-space signal handling function - * signo, info, and ucontext - Standard arguments to be passed to the - * signal handling function. - * - * Returned Value: - * None. This function does not return in the normal sense. It returns - * via an architecture specific system call made by up_signal_handler(). - * However, this will look like a normal return by the caller of - * up_signal_dispatch. - * - ****************************************************************************/ - -void up_signal_dispatch(_sa_sigaction_t sighand, int signo, - FAR siginfo_t *info, FAR void *ucontext) -{ - /* We are signalling a user group, but does the signal handler lie in the - * user address space? Or the kernel address space? The OS does - * intercept some signals for its own purpose (such as the death-of-child - * signal. - */ - - if (arm_uservaddr((uintptr_t)sighand)) - { - /* Yes.. Let sys_call4() do all of the work to get us into user space */ - - sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); - } - else - { - /* No.. we are already in kernel mode so just call the handler */ - - sighand(signo, info, ucontext); - } -} - -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ diff --git a/arch/arm/src/armv8-m/arm_signal_dispatch.c b/arch/arm/src/armv8-m/arm_signal_dispatch.c deleted file mode 100644 index 62baf3cba1d..00000000000 --- a/arch/arm/src/armv8-m/arm_signal_dispatch.c +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** - * arch/arm/src/armv8-m/arm_signal_dispatch.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include - -#include "arm_internal.h" - -#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_signal_dispatch - * - * Description: - * In the kernel mode build, this function will be called to execute a - * a signal handler in user-space. When the signal is delivered, a - * kernel-mode stub will first run to perform some housekeeping functions. - * This kernel-mode stub will then be called transfer control to the user - * mode signal handler by calling this function. - * - * Normally the user-mode signaling handling stub will also execute - * before the ultimate signal handler is called. See - * arch/arm/src/armv8-m/gnu/arm_signal_handler.S. This function is the - * user-space, signal handler trampoline function. It is called from - * up_signal_dispatch() in user-mode. - * - * Input Parameters: - * sighand - The address user-space signal handling function - * signo, info, and ucontext - Standard arguments to be passed to the - * signal handling function. - * - * Returned Value: - * None. This function does not return in the normal sense. It returns - * via an architecture specific system call made by up_signal_handler(). - * However, this will look like a normal return by the caller of - * up_signal_dispatch. - * - ****************************************************************************/ - -void up_signal_dispatch(_sa_sigaction_t sighand, int signo, - FAR siginfo_t *info, FAR void *ucontext) -{ - /* Let sys_call4() do all of the work */ - - sys_call4(SYS_signal_handler, (uintptr_t)sighand, (uintptr_t)signo, - (uintptr_t)info, (uintptr_t)ucontext); -} - -#endif /* !CONFIG_BUILD_FLAT && __KERNEL__ */ diff --git a/arch/arm/src/armv7-m/arm_signal_dispatch.c b/arch/arm/src/common/arm_signal_dispatch.c similarity index 96% rename from arch/arm/src/armv7-m/arm_signal_dispatch.c rename to arch/arm/src/common/arm_signal_dispatch.c index 4b6b4720d13..ff86c44e27d 100644 --- a/arch/arm/src/armv7-m/arm_signal_dispatch.c +++ b/arch/arm/src/common/arm_signal_dispatch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/armv7-m/arm_signal_dispatch.c + * arch/arm/src/common/arm_signal_dispatch.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -47,7 +47,7 @@ * * Normally the user-mode signaling handling stub will also execute * before the ultimate signal handler is called. See - * arch/arm/src/armv7-m/gnu/arm_signal_handler.S. This function is the + * arch/arm/src/armvx-y/arm_signal_handler.S. This function is the * user-space, signal handler trampoline function. It is called from * up_signal_dispatch() in user-mode. *