diff --git a/arch/arm/src/common/CMakeLists.txt b/arch/arm/src/common/CMakeLists.txt index f84143fcaf9..4f4a3eeb0ff 100644 --- a/arch/arm/src/common/CMakeLists.txt +++ b/arch/arm/src/common/CMakeLists.txt @@ -43,10 +43,6 @@ set(SRCS arm_poweroff.c ${ARCH_TOOLCHAIN_PATH}/fork.S) -if(NOT CONFIG_ALARM_ARCH AND NOT CONFIG_TIMER_ARCH) - list(APPEND SRCS arm_mdelay.c arm_udelay.c) -endif() - if(CONFIG_STACK_COLORATION) list(APPEND SRCS arm_checkstack.c) endif() diff --git a/arch/arm/src/common/Make.defs b/arch/arm/src/common/Make.defs index c0722eb1f51..7616bd472de 100644 --- a/arch/arm/src/common/Make.defs +++ b/arch/arm/src/common/Make.defs @@ -30,12 +30,6 @@ CMN_CSRCS += arm_nputs.c arm_releasestack.c arm_registerdump.c CMN_CSRCS += arm_stackframe.c arm_modifyreg.c CMN_CSRCS += arm_usestack.c arm_fork.c arm_poweroff.c -ifneq ($(CONFIG_ALARM_ARCH),y) - ifneq ($(CONFIG_TIMER_ARCH),y) - CMN_CSRCS += arm_mdelay.c arm_udelay.c - endif -endif - ifeq ($(CONFIG_STACK_COLORATION),y) CMN_CSRCS += arm_checkstack.c endif diff --git a/arch/arm/src/common/arm_mdelay.c b/arch/arm/src/common/arm_mdelay.c deleted file mode 100644 index 26ec51255c7..00000000000 --- a/arch/arm/src/common/arm_mdelay.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * arch/arm/src/common/arm_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile unsigned int i; - volatile unsigned int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/arm/src/common/arm_udelay.c b/arch/arm/src/common/arm_udelay.c deleted file mode 100644 index 5baae6903e2..00000000000 --- a/arch/arm/src/common/arm_udelay.c +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - * arch/arm/src/common/arm_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/arm/src/tlsr82/tc32/Make.defs b/arch/arm/src/tlsr82/tc32/Make.defs index 9df43201dc7..8be5e2e0324 100644 --- a/arch/arm/src/tlsr82/tc32/Make.defs +++ b/arch/arm/src/tlsr82/tc32/Make.defs @@ -38,7 +38,7 @@ CMN_ASRCS := # Filter-out unnecessary .c files TC32_CSRCS_FILTER := arm_backtrace_fp.c arm_backtrace_thumb.c -TC32_CSRCS_FILTER += arm_fullcontextrestore.c arm_udelay.c +TC32_CSRCS_FILTER += arm_fullcontextrestore.c CMN_CSRCS := $(filter-out $(TC32_CSRCS_FILTER), $(CMN_CSRCS)) # Filter-out unnecessary .S files diff --git a/arch/avr/src/at32uc3/Make.defs b/arch/avr/src/at32uc3/Make.defs index 18d592c636c..ea6485cde7d 100644 --- a/arch/avr/src/at32uc3/Make.defs +++ b/arch/avr/src/at32uc3/Make.defs @@ -28,7 +28,7 @@ HEAD_ASRC = avr_nommuhead.S CMN_ASRCS = avr_exceptions.S avr_fullcontextrestore.S avr_doswitch.S avr_saveusercontext.S CMN_CSRCS = avr_allocateheap.c avr_copystate.c avr_createstack.c avr_exit.c -CMN_CSRCS += avr_mdelay.c avr_udelay.c avr_initialize.c avr_initialstate.c avr_idle.c +CMN_CSRCS += avr_initialize.c avr_initialstate.c avr_idle.c CMN_CSRCS += avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c avr_releasestack.c CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_stackframe.c avr_switchcontext.c CMN_CSRCS += avr_usestack.c avr_doirq.c avr_nputs.c avr_registerdump.c avr_getintstack.c diff --git a/arch/avr/src/at90usb/Make.defs b/arch/avr/src/at90usb/Make.defs index d6221ce5cc6..71138b4f9a9 100644 --- a/arch/avr/src/at90usb/Make.defs +++ b/arch/avr/src/at90usb/Make.defs @@ -28,8 +28,8 @@ HEAD_ASRC = at90usb_head.S CMN_ASRCS = avr_doswitch.S avr_saveusercontext.S CMN_CSRCS = avr_allocateheap.c avr_copystate.c avr_createstack.c -CMN_CSRCS += avr_doirq.c avr_exit.c avr_idle.c avr_irq.c avr_udelay.c -CMN_CSRCS += avr_initialize.c avr_initialstate.c avr_lowputs.c avr_mdelay.c +CMN_CSRCS += avr_doirq.c avr_exit.c avr_idle.c avr_irq.c +CMN_CSRCS += avr_initialize.c avr_initialstate.c avr_lowputs.c CMN_CSRCS += avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c CMN_CSRCS += avr_nputs.c avr_releasestack.c avr_registerdump.c CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_getintstack.c diff --git a/arch/avr/src/atmega/Make.defs b/arch/avr/src/atmega/Make.defs index 8cef1e273b7..d53a0fcddab 100644 --- a/arch/avr/src/atmega/Make.defs +++ b/arch/avr/src/atmega/Make.defs @@ -29,11 +29,11 @@ HEAD_ASRC = atmega_head.S CMN_ASRCS = avr_doswitch.S avr_saveusercontext.S CMN_CSRCS = avr_allocateheap.c avr_copystate.c avr_createstack.c CMN_CSRCS += avr_doirq.c avr_exit.c avr_idle.c avr_initialize.c -CMN_CSRCS += avr_initialstate.c avr_irq.c avr_lowputs.c avr_mdelay.c +CMN_CSRCS += avr_initialstate.c avr_irq.c avr_lowputs.c CMN_CSRCS += avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c CMN_CSRCS += avr_nputs.c avr_releasestack.c avr_registerdump.c CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_getintstack.c -CMN_CSRCS += avr_stackframe.c avr_udelay.c avr_switchcontext.c avr_usestack.c +CMN_CSRCS += avr_stackframe.c avr_switchcontext.c avr_usestack.c # Configuration-dependent common files diff --git a/arch/avr/src/avrdx/Make.defs b/arch/avr/src/avrdx/Make.defs index 8d6741875db..fd3e06cc81e 100644 --- a/arch/avr/src/avrdx/Make.defs +++ b/arch/avr/src/avrdx/Make.defs @@ -29,10 +29,10 @@ HEAD_ASRC = avrdx_head.S CMN_ASRCS = avr_doswitch.S avr_saveusercontext.S CMN_CSRCS = avr_allocateheap.c avr_copystate.c avr_createstack.c CMN_CSRCS += avr_doirq.c avr_exit.c avr_idle.c avr_initialize.c -CMN_CSRCS += avr_initialstate.c avr_irq.c avr_lowputs.c avr_mdelay.c +CMN_CSRCS += avr_initialstate.c avr_irq.c avr_lowputs.c CMN_CSRCS += avr_nputs.c avr_releasestack.c avr_registerdump.c CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_getintstack.c -CMN_CSRCS += avr_stackframe.c avr_udelay.c avr_switchcontext.c avr_usestack.c +CMN_CSRCS += avr_stackframe.c avr_switchcontext.c avr_usestack.c # Configuration-dependent common files diff --git a/arch/avr/src/common/avr_mdelay.c b/arch/avr/src/common/avr_mdelay.c deleted file mode 100644 index 315501656f8..00000000000 --- a/arch/avr/src/common/avr_mdelay.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * arch/avr/src/common/avr_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/avr/src/common/avr_udelay.c b/arch/avr/src/common/avr_udelay.c deleted file mode 100644 index c348f80afe6..00000000000 --- a/arch/avr/src/common/avr_udelay.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * arch/avr/src/common/avr_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/hc/src/common/hc_mdelay.c b/arch/hc/src/common/hc_mdelay.c deleted file mode 100644 index 8af76550f5a..00000000000 --- a/arch/hc/src/common/hc_mdelay.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * arch/hc/src/common/hc_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/hc/src/common/hc_udelay.c b/arch/hc/src/common/hc_udelay.c deleted file mode 100644 index 5ecd3b7919c..00000000000 --- a/arch/hc/src/common/hc_udelay.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * arch/hc/src/common/hc_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/hc/src/m9s12/Make.defs b/arch/hc/src/m9s12/Make.defs index 2486eacb07c..4f08b67da26 100644 --- a/arch/hc/src/m9s12/Make.defs +++ b/arch/hc/src/m9s12/Make.defs @@ -24,9 +24,9 @@ HEAD_ASRC = m9s12_vectors.S CMN_CSRCS = hc_allocateheap.c hc_copystate.c hc_createstack.c hc_doirq.c CMN_CSRCS += hc_exit.c hc_getintstack.c hc_idle.c hc_initialize.c -CMN_CSRCS += hc_mdelay.c hc_modifyreg16.c hc_modifyreg32.c hc_modifyreg8.c +CMN_CSRCS += hc_modifyreg16.c hc_modifyreg32.c hc_modifyreg8.c CMN_CSRCS += hc_nputs.c hc_releasestack.c hc_stackframe.c hc_switchcontext.c -CMN_CSRCS += hc_udelay.c hc_usestack.c +CMN_CSRCS += hc_usestack.c CHIP_ASRCS = m9s12_start.S m9s12_lowputc.S m9s12_saveusercontext.S CHIP_CSRCS = m9s12_gpio.c m9s12_gpioirq.c m9s12_initialstate.c diff --git a/arch/mips/src/common/mips_mdelay.c b/arch/mips/src/common/mips_mdelay.c deleted file mode 100644 index 0f05da8a0c2..00000000000 --- a/arch/mips/src/common/mips_mdelay.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * arch/mips/src/common/mips_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/mips/src/common/mips_udelay.c b/arch/mips/src/common/mips_udelay.c deleted file mode 100644 index 54509bbc888..00000000000 --- a/arch/mips/src/common/mips_udelay.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * arch/mips/src/common/mips_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/mips/src/pic32mx/Make.defs b/arch/mips/src/pic32mx/Make.defs index b02e4de3dfc..9c0c82d5a19 100644 --- a/arch/mips/src/pic32mx/Make.defs +++ b/arch/mips/src/pic32mx/Make.defs @@ -29,12 +29,12 @@ HEAD_ASRC = pic32mx_head.S CMN_ASRCS = mips_syscall0.S fork.S CMN_CSRCS = mips_allocateheap.c mips_copystate.c mips_createstack.c CMN_CSRCS += mips_doirq.c mips_exit.c mips_getintstack.c mips_initialize.c -CMN_CSRCS += mips_initialstate.c mips_irq.c mips_lowputs.c mips_mdelay.c +CMN_CSRCS += mips_initialstate.c mips_irq.c mips_lowputs.c CMN_CSRCS += mips_modifyreg8.c mips_modifyreg16.c mips_modifyreg32.c CMN_CSRCS += mips_nputs.c mips_releasestack.c mips_registerdump.c CMN_CSRCS += mips_schedulesigaction.c mips_sigdeliver.c mips_swint0.c CMN_CSRCS += mips_stackframe.c mips_switchcontext.c mips_saveusercontext.c -CMN_CSRCS += mips_udelay.c mips_usestack.c mips_fork.c +CMN_CSRCS += mips_usestack.c mips_fork.c # Configuration dependent common files diff --git a/arch/mips/src/pic32mz/Make.defs b/arch/mips/src/pic32mz/Make.defs index 07f572cf1a3..0fafb6de69a 100644 --- a/arch/mips/src/pic32mz/Make.defs +++ b/arch/mips/src/pic32mz/Make.defs @@ -29,12 +29,12 @@ HEAD_ASRC = pic32mz_head.S CMN_ASRCS = mips_syscall0.S fork.S mips_cache.S CMN_CSRCS = mips_allocateheap.c mips_copystate.c mips_createstack.c CMN_CSRCS += mips_doirq.c mips_exit.c mips_getintstack.c mips_initialize.c -CMN_CSRCS += mips_initialstate.c mips_irq.c mips_lowputs.c mips_mdelay.c +CMN_CSRCS += mips_initialstate.c mips_irq.c mips_lowputs.c CMN_CSRCS += mips_modifyreg8.c mips_modifyreg16.c mips_modifyreg32.c CMN_CSRCS += mips_nputs.c mips_releasestack.c mips_registerdump.c CMN_CSRCS += mips_schedulesigaction.c mips_sigdeliver.c mips_swint0.c CMN_CSRCS += mips_stackframe.c mips_switchcontext.c mips_saveusercontext.c -CMN_CSRCS += mips_udelay.c mips_usestack.c mips_fork.c +CMN_CSRCS += mips_usestack.c mips_fork.c # Configuration dependent common files diff --git a/arch/misoc/src/common/misoc_mdelay.c b/arch/misoc/src/common/misoc_mdelay.c deleted file mode 100644 index fd0f0fb12d5..00000000000 --- a/arch/misoc/src/common/misoc_mdelay.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * arch/misoc/src/common/misoc_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/misoc/src/common/misoc_udelay.c b/arch/misoc/src/common/misoc_udelay.c deleted file mode 100644 index 3e5711ba1bb..00000000000 --- a/arch/misoc/src/common/misoc_udelay.c +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - * arch/misoc/src/common/misoc_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/misoc/src/lm32/Make.defs b/arch/misoc/src/lm32/Make.defs index 9182cf4978e..b2847f7d25f 100644 --- a/arch/misoc/src/lm32/Make.defs +++ b/arch/misoc/src/lm32/Make.defs @@ -23,8 +23,8 @@ HEAD_ASRC = lm32_vectors.S CMN_CSRCS = misoc_initialize.c misoc_lowputs.c misoc_serial.c -CMN_CSRCS += misoc_mdelay.c misoc_modifyreg8.c misoc_modifyreg16.c -CMN_CSRCS += misoc_modifyreg32.c misoc_puts.c misoc_udelay.c +CMN_CSRCS += misoc_modifyreg8.c misoc_modifyreg16.c +CMN_CSRCS += misoc_modifyreg32.c misoc_puts.c CMN_CSRCS += misoc_timerisr.c misoc_net.c misoc_flushcache.c CHIP_ASRCS = lm32_syscall.S diff --git a/arch/misoc/src/minerva/Make.defs b/arch/misoc/src/minerva/Make.defs index 2bf7486196d..e7285c01fd7 100644 --- a/arch/misoc/src/minerva/Make.defs +++ b/arch/misoc/src/minerva/Make.defs @@ -23,8 +23,8 @@ HEAD_ASRC = minerva_vectors.S CMN_CSRCS = misoc_initialize.c misoc_lowputs.c misoc_serial.c -CMN_CSRCS += misoc_mdelay.c misoc_modifyreg8.c misoc_modifyreg16.c -CMN_CSRCS += misoc_modifyreg32.c misoc_puts.c misoc_udelay.c +CMN_CSRCS += misoc_modifyreg8.c misoc_modifyreg16.c +CMN_CSRCS += misoc_modifyreg32.c misoc_puts.c CMN_CSRCS += misoc_timerisr.c misoc_net.c misoc_flushcache.c CHIP_ASRCS = minerva_syscall.S diff --git a/arch/or1k/src/common/or1k_mdelay.c b/arch/or1k/src/common/or1k_mdelay.c deleted file mode 100644 index e92b15e991c..00000000000 --- a/arch/or1k/src/common/or1k_mdelay.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * arch/or1k/src/common/or1k_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile unsigned int i; - volatile unsigned int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/or1k/src/common/or1k_udelay.c b/arch/or1k/src/common/or1k_udelay.c deleted file mode 100644 index 686f780aa4a..00000000000 --- a/arch/or1k/src/common/or1k_udelay.c +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - * arch/or1k/src/common/or1k_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/or1k/src/mor1kx/Make.defs b/arch/or1k/src/mor1kx/Make.defs index c4987c73e4a..8278d37f66f 100644 --- a/arch/or1k/src/mor1kx/Make.defs +++ b/arch/or1k/src/mor1kx/Make.defs @@ -37,8 +37,6 @@ CMN_CSRCS = or1k_initialize.c \ or1k_registerdump.c \ or1k_getintstack.c \ or1k_exit.c \ - or1k_udelay.c \ - or1k_mdelay.c \ or1k_idle.c \ or1k_irq.c \ or1k_nputs.c \ diff --git a/arch/renesas/src/common/renesas_mdelay.c b/arch/renesas/src/common/renesas_mdelay.c deleted file mode 100644 index 23bd942b077..00000000000 --- a/arch/renesas/src/common/renesas_mdelay.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * arch/renesas/src/common/renesas_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/renesas/src/common/renesas_udelay.c b/arch/renesas/src/common/renesas_udelay.c deleted file mode 100644 index 6d47de90949..00000000000 --- a/arch/renesas/src/common/renesas_udelay.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * arch/renesas/src/common/renesas_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/renesas/src/m16c/Make.defs b/arch/renesas/src/m16c/Make.defs index d63829cf5c7..2ca404f53ae 100644 --- a/arch/renesas/src/m16c/Make.defs +++ b/arch/renesas/src/m16c/Make.defs @@ -24,9 +24,9 @@ HEAD_ASRC = m16c_head.S CMN_CSRCS = renesas_allocateheap.c renesas_createstack.c renesas_doirq.c CMN_CSRCS += renesas_exit.c renesas_getintstack.c renesas_idle.c -CMN_CSRCS += renesas_initialize.c renesas_lowputs.c renesas_mdelay.c +CMN_CSRCS += renesas_initialize.c renesas_lowputs.c CMN_CSRCS += renesas_nputs.c renesas_releasestack.c renesas_stackframe.c -CMN_CSRCS += renesas_switchcontext.c renesas_udelay.c renesas_usestack.c +CMN_CSRCS += renesas_switchcontext.c renesas_usestack.c CHIP_ASRCS = m16c_vectors.S CHIP_CSRCS = m16c_initialstate.c m16c_copystate.c m16c_lowputc.c m16c_irq.c diff --git a/arch/renesas/src/rx65n/Make.defs b/arch/renesas/src/rx65n/Make.defs index 5c705241e21..ea5004a72ed 100644 --- a/arch/renesas/src/rx65n/Make.defs +++ b/arch/renesas/src/rx65n/Make.defs @@ -24,9 +24,9 @@ HEAD_ASRC = rx65n_head.S CMN_CSRCS = renesas_allocateheap.c renesas_createstack.c renesas_doirq.c CMN_CSRCS += renesas_exit.c renesas_getintstack.c renesas_initialize.c -CMN_CSRCS += renesas_idle.c renesas_lowputs.c renesas_mdelay.c renesas_nputs.c +CMN_CSRCS += renesas_idle.c renesas_lowputs.c renesas_nputs.c CMN_CSRCS += renesas_releasestack.c renesas_switchcontext.c renesas_stackframe.c -CMN_CSRCS += renesas_udelay.c renesas_usestack.c +CMN_CSRCS += renesas_usestack.c CHIP_ASRCS = rx65n_vector.S CHIP_CSRCS = rx65n_lowputc.c rx65n_serial.c rx65n_copystate.c rx65n_irq.c diff --git a/arch/renesas/src/sh1/Make.defs b/arch/renesas/src/sh1/Make.defs index b595f373612..ecef2adf951 100644 --- a/arch/renesas/src/sh1/Make.defs +++ b/arch/renesas/src/sh1/Make.defs @@ -25,8 +25,8 @@ HEAD_ASRC = sh1_head.S CMN_CSRCS = renesas_allocateheap.c renesas_createstack.c renesas_doirq.c CMN_CSRCS += renesas_exit.c renesas_getintstack.c renesas_initialize.c CMN_CSRCS += renesas_idle.c renesas_initialstate.c renesas_lowputs.c -CMN_CSRCS += renesas_mdelay.c renesas_nputs.c renesas_releasestack.c -CMN_CSRCS += renesas_stackframe.c renesas_switchcontext.c renesas_udelay.c +CMN_CSRCS += renesas_nputs.c renesas_releasestack.c +CMN_CSRCS += renesas_stackframe.c renesas_switchcontext.c CMN_CSRCS += renesas_usestack.c sh1_schedulesigaction.c sh1_sigdeliver.c CHIP_ASRCS = sh1_vector.S sh1_saveusercontext.S diff --git a/arch/risc-v/src/common/CMakeLists.txt b/arch/risc-v/src/common/CMakeLists.txt index 73aefa3c789..c4473a1366a 100644 --- a/arch/risc-v/src/common/CMakeLists.txt +++ b/arch/risc-v/src/common/CMakeLists.txt @@ -39,12 +39,6 @@ if(NOT CONFIG_ARCH_IDLE_CUSTOM) list(APPEND SRCS riscv_idle.c) endif() -if(NOT CONFIG_ALARM_ARCH) - if(NOT CONFIG_TIMER_ARCH) - list(APPEND SRCS riscv_mdelay.c riscv_udelay.c) - endif() -endif() - if(CONFIG_SMP) list(APPEND SRCS riscv_smpcall.c riscv_cpustart.c) endif() diff --git a/arch/risc-v/src/common/Make.defs b/arch/risc-v/src/common/Make.defs index b24560bb7d6..0e0ab36b1e9 100644 --- a/arch/risc-v/src/common/Make.defs +++ b/arch/risc-v/src/common/Make.defs @@ -40,12 +40,6 @@ ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y) CMN_CSRCS += riscv_idle.c endif -ifneq ($(CONFIG_ALARM_ARCH),y) - ifneq ($(CONFIG_TIMER_ARCH),y) - CMN_CSRCS += riscv_mdelay.c riscv_udelay.c - endif -endif - ifeq ($(CONFIG_SMP),y) CMN_CSRCS += riscv_smpcall.c riscv_cpustart.c endif diff --git a/arch/risc-v/src/common/riscv_mdelay.c b/arch/risc-v/src/common/riscv_mdelay.c deleted file mode 100644 index 6a790773bcf..00000000000 --- a/arch/risc-v/src/common/riscv_mdelay.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * arch/risc-v/src/common/riscv_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile unsigned int i; - volatile unsigned int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/risc-v/src/common/riscv_udelay.c b/arch/risc-v/src/common/riscv_udelay.c deleted file mode 100644 index 1bfac9ee0c6..00000000000 --- a/arch/risc-v/src/common/riscv_udelay.c +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - * arch/risc-v/src/common/riscv_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/sparc/src/common/Make.defs b/arch/sparc/src/common/Make.defs index 82d0a71f697..a1217ecf3ae 100644 --- a/arch/sparc/src/common/Make.defs +++ b/arch/sparc/src/common/Make.defs @@ -24,10 +24,10 @@ CMN_CSRCS += sparc_allocateheap.c sparc_createstack.c sparc_exit.c CMN_CSRCS += sparc_idle.c sparc_initialize.c -CMN_CSRCS += sparc_lowputs.c sparc_mdelay.c sparc_modifyreg8.c +CMN_CSRCS += sparc_lowputs.c sparc_modifyreg8.c CMN_CSRCS += sparc_modifyreg16.c sparc_modifyreg32.c sparc_nputs.c CMN_CSRCS += sparc_releasestack.c sparc_stackframe.c -CMN_CSRCS += sparc_udelay.c sparc_usestack.c sparc_tcbinfo.c +CMN_CSRCS += sparc_usestack.c sparc_tcbinfo.c # Configuration-dependent common files diff --git a/arch/sparc/src/common/sparc_mdelay.c b/arch/sparc/src/common/sparc_mdelay.c deleted file mode 100644 index cc23a823ee1..00000000000 --- a/arch/sparc/src/common/sparc_mdelay.c +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** - * arch/sparc/src/common/sparc_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} - diff --git a/arch/tricore/src/common/CMakeLists.txt b/arch/tricore/src/common/CMakeLists.txt index 39e3e0ee365..1183ed621e9 100644 --- a/arch/tricore/src/common/CMakeLists.txt +++ b/arch/tricore/src/common/CMakeLists.txt @@ -32,7 +32,6 @@ set(SRCS tricore_initialstate.c tricore_irq.c tricore_main.c - tricore_mdelay.c tricore_nputs.c tricore_registerdump.c tricore_releasestack.c diff --git a/arch/tricore/src/common/Make.defs b/arch/tricore/src/common/Make.defs index 9dafdfe495a..c3e9c77dd30 100644 --- a/arch/tricore/src/common/Make.defs +++ b/arch/tricore/src/common/Make.defs @@ -33,7 +33,6 @@ CMN_CSRCS += tricore_initialize.c CMN_CSRCS += tricore_initialstate.c CMN_CSRCS += tricore_irq.c CMN_CSRCS += tricore_main.c -CMN_CSRCS += tricore_mdelay.c CMN_CSRCS += tricore_nputs.c CMN_CSRCS += tricore_registerdump.c CMN_CSRCS += tricore_releasestack.c diff --git a/arch/tricore/src/common/tricore_mdelay.c b/arch/tricore/src/common/tricore_mdelay.c deleted file mode 100644 index 95213e3d28f..00000000000 --- a/arch/tricore/src/common/tricore_mdelay.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * arch/tricore/src/common/tricore_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile unsigned int i; - volatile unsigned int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/x86/src/common/x86_mdelay.c b/arch/x86/src/common/x86_mdelay.c deleted file mode 100644 index c880ceab6b2..00000000000 --- a/arch/x86/src/common/x86_mdelay.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - * arch/x86/src/common/x86_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/x86/src/common/x86_udelay.c b/arch/x86/src/common/x86_udelay.c deleted file mode 100644 index 649268cecef..00000000000 --- a/arch/x86/src/common/x86_udelay.c +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** - * arch/x86/src/common/x86_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/x86/src/qemu/Make.defs b/arch/x86/src/qemu/Make.defs index 169e4a80612..893ad50af4b 100644 --- a/arch/x86/src/qemu/Make.defs +++ b/arch/x86/src/qemu/Make.defs @@ -30,9 +30,9 @@ CMN_ASRCS = i486_utils.S i486_syscall6.S CMN_CSRCS += i486_createstack.c i486_initialstate.c CMN_CSRCS += x86_allocateheap.c x86_copystate.c x86_exit.c -CMN_CSRCS += x86_getintstack.c x86_initialize.c x86_mdelay.c +CMN_CSRCS += x86_getintstack.c x86_initialize.c CMN_CSRCS += x86_modifyreg8.c x86_modifyreg16.c x86_modifyreg32.c -CMN_CSRCS += x86_nputs.c x86_switchcontext.c x86_udelay.c x86_tcbinfo.c +CMN_CSRCS += x86_nputs.c x86_switchcontext.c x86_tcbinfo.c CMN_CSRCS += i486_irq.c i486_regdump.c i486_releasestack.c CMN_CSRCS += i486_savestate.c i486_sigdeliver.c i486_stackframe.c CMN_CSRCS += i486_schedulesigaction.c i486_usestack.c diff --git a/arch/x86_64/src/common/CMakeLists.txt b/arch/x86_64/src/common/CMakeLists.txt index 5186b6cd109..c797d00619e 100644 --- a/arch/x86_64/src/common/CMakeLists.txt +++ b/arch/x86_64/src/common/CMakeLists.txt @@ -67,10 +67,6 @@ if(NOT CONFIG_BUILD_FLAT) x86_64_signal_dispatch.c) endif() -if(NOT CONFIG_ALARM_ARCH) - list(APPEND SRCS x86_64_udelay.c x86_64_mdelay.c) -endif() - if(CONFIG_ARCH_KERNEL_STACK) list(APPEND SRCS x86_64_addrenv_kstack.c) endif() diff --git a/arch/x86_64/src/common/Make.defs b/arch/x86_64/src/common/Make.defs index aadf928214d..f63e2cbce82 100644 --- a/arch/x86_64/src/common/Make.defs +++ b/arch/x86_64/src/common/Make.defs @@ -69,10 +69,6 @@ CMN_CSRCS += x86_64_signal_dispatch.c CMN_UASRCS += x86_64_signal_handler.S endif -ifndef CONFIG_ALARM_ARCH -CMN_CSRCS += x86_64_udelay.c x86_64_mdelay.c -endif - ifeq ($(CONFIG_ARCH_HAVE_DEBUG),y) CMN_CSRCS += x86_64_hwdebug.c endif diff --git a/arch/x86_64/src/common/x86_64_mdelay.c b/arch/x86_64/src/common/x86_64_mdelay.c deleted file mode 100644 index f2bc7ac8791..00000000000 --- a/arch/x86_64/src/common/x86_64_mdelay.c +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** - * arch/x86_64/src/common/x86_64_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ -#ifdef CONFIG_ARCH_INTEL64_HAVE_TSC - up_ndelay(milliseconds * NSEC_PER_MSEC); -#else - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -#endif -} diff --git a/arch/x86_64/src/common/x86_64_udelay.c b/arch/x86_64/src/common/x86_64_udelay.c deleted file mode 100644 index 776add2e485..00000000000 --- a/arch/x86_64/src/common/x86_64_udelay.c +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - * arch/x86_64/src/common/x86_64_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ -#ifdef CONFIG_ARCH_INTEL64_HAVE_TSC - up_ndelay(microseconds * NSEC_PER_USEC); -#else - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -#endif -} diff --git a/arch/xtensa/src/common/CMakeLists.txt b/arch/xtensa/src/common/CMakeLists.txt index 6ff581120e5..089976c79e6 100644 --- a/arch/xtensa/src/common/CMakeLists.txt +++ b/arch/xtensa/src/common/CMakeLists.txt @@ -60,7 +60,6 @@ list( xtensa_initialstate.c xtensa_irqdispatch.c xtensa_lowputs.c - xtensa_mdelay.c xtensa_modifyreg8.c xtensa_modifyreg16.c xtensa_modifyreg32.c @@ -75,7 +74,6 @@ list( xtensa_stackframe.c xtensa_saveusercontext.c xtensa_schedsigaction.c - xtensa_udelay.c xtensa_usestack.c xtensa_tcbinfo.c) diff --git a/arch/xtensa/src/common/Make.defs b/arch/xtensa/src/common/Make.defs index d0ba9e289f9..7a6fe24ae9c 100644 --- a/arch/xtensa/src/common/Make.defs +++ b/arch/xtensa/src/common/Make.defs @@ -34,12 +34,12 @@ CMN_ASRCS = xtensa_context.S xtensa_panic.S CMN_CSRCS = xtensa_assert.c xtensa_cache.c xtensa_cpenable.c CMN_CSRCS += xtensa_cpuinfo.c xtensa_cpuint.c xtensa_createstack.c xtensa_exit.c CMN_CSRCS += xtensa_getintstack.c xtensa_initialize.c xtensa_initialstate.c -CMN_CSRCS += xtensa_irqdispatch.c xtensa_lowputs.c xtensa_mdelay.c +CMN_CSRCS += xtensa_irqdispatch.c xtensa_lowputs.c CMN_CSRCS += xtensa_modifyreg8.c xtensa_modifyreg16.c xtensa_modifyreg32.c CMN_CSRCS += xtensa_mpu.c xtensa_nputs.c xtensa_oneshot.c xtensa_perf.c CMN_CSRCS += xtensa_releasestack.c xtensa_registerdump.c xtensa_sigdeliver.c CMN_CSRCS += xtensa_swint.c xtensa_stackframe.c -CMN_CSRCS += xtensa_saveusercontext.c xtensa_schedsigaction.c xtensa_udelay.c +CMN_CSRCS += xtensa_saveusercontext.c xtensa_schedsigaction.c CMN_CSRCS += xtensa_usestack.c xtensa_tcbinfo.c # Configuration-dependent common Xtensa files diff --git a/arch/xtensa/src/common/xtensa_mdelay.c b/arch/xtensa/src/common/xtensa_mdelay.c deleted file mode 100644 index 3e6d7ad25c7..00000000000 --- a/arch/xtensa/src/common/xtensa_mdelay.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * arch/xtensa/src/common/xtensa_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} diff --git a/arch/xtensa/src/common/xtensa_udelay.c b/arch/xtensa/src/common/xtensa_udelay.c deleted file mode 100644 index 45b6423c0f0..00000000000 --- a/arch/xtensa/src/common/xtensa_udelay.c +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - * arch/xtensa/src/common/xtensa_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} diff --git a/arch/z16/src/common/z16_mdelay.c b/arch/z16/src/common/z16_mdelay.c deleted file mode 100644 index cc79d1dac18..00000000000 --- a/arch/z16/src/common/z16_mdelay.c +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - * arch/z16/src/common/z16_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -#ifdef CONFIG_BOARD_LOOPSPERMSEC - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} -#endif /* CONFIG_BOARD_LOOPSPERMSEC */ diff --git a/arch/z16/src/common/z16_udelay.c b/arch/z16/src/common/z16_udelay.c deleted file mode 100644 index 0cac8b3e09f..00000000000 --- a/arch/z16/src/common/z16_udelay.c +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * arch/z16/src/common/z16_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -#ifdef CONFIG_BOARD_LOOPSPERMSEC - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} -#endif /* CONFIG_BOARD_LOOPSPERMSEC */ diff --git a/arch/z16/src/z16f/Make.defs b/arch/z16/src/z16f/Make.defs index d48204ad070..1563e48977c 100644 --- a/arch/z16/src/z16f/Make.defs +++ b/arch/z16/src/z16f/Make.defs @@ -24,9 +24,9 @@ HEAD_SSRC = z16f_head.S CMN_CSRCS = z16_allocateheap.c z16_copystate.c z16_createstack.c z16_doirq.c CMN_CSRCS += z16_exit.c z16_initialstate.c z16_initialize.c z16_idle.c -CMN_CSRCS += z16_mdelay.c z16_nputs.c z16_registerdump.c z16_releasestack.c +CMN_CSRCS += z16_nputs.c z16_registerdump.c z16_releasestack.c CMN_CSRCS += z16_schedulesigaction.c z16_sigdeliver.c z16_switchcontext.c -CMN_CSRCS += z16_stackframe.c z16_udelay.c z16_usestack.c +CMN_CSRCS += z16_stackframe.c z16_usestack.c CHIP_SSRCS = z16f_lowuart.S z16f_saveusercontext.S z16f_restoreusercontext.S CHIP_CSRCS = z16f_clkinit.c z16f_sysexec.c z16f_irq.c z16f_serial.c diff --git a/arch/z80/src/common/z80_mdelay.c b/arch/z80/src/common/z80_mdelay.c deleted file mode 100644 index b1db5ebd268..00000000000 --- a/arch/z80/src/common/z80_mdelay.c +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - * arch/z80/src/common/z80_mdelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -#ifdef CONFIG_BOARD_LOOPSPERMSEC - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_mdelay(unsigned int milliseconds) -{ - volatile int i; - volatile int j; - - for (i = 0; i < milliseconds; i++) - { - for (j = 0; j < CONFIG_BOARD_LOOPSPERMSEC; j++) - { - } - } -} -#endif /* CONFIG_BOARD_LOOPSPERMSEC */ diff --git a/arch/z80/src/common/z80_udelay.c b/arch/z80/src/common/z80_udelay.c deleted file mode 100644 index cefabcf8b8b..00000000000 --- a/arch/z80/src/common/z80_udelay.c +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - * arch/z80/src/common/z80_udelay.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * 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 - -#ifdef CONFIG_BOARD_LOOPSPERMSEC - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} -#endif /* CONFIG_BOARD_LOOPSPERMSEC */ diff --git a/arch/z80/src/ez80/Make.defs b/arch/z80/src/ez80/Make.defs index 8aed44202ec..61aa51c3c3c 100644 --- a/arch/z80/src/ez80/Make.defs +++ b/arch/z80/src/ez80/Make.defs @@ -22,9 +22,9 @@ CMN_CSRCS = z80_allocateheap.c z80_createstack.c z80_doirq.c CMN_CSRCS += z80_exit.c z80_interruptcontext.c z80_idle.c -CMN_CSRCS += z80_initialize.c z80_mdelay.c z80_nputs.c +CMN_CSRCS += z80_initialize.c z80_nputs.c CMN_CSRCS += z80_releasestack.c z80_switchcontext.c -CMN_CSRCS += z80_stackframe.c z80_udelay.c z80_usestack.c +CMN_CSRCS += z80_stackframe.c z80_usestack.c CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_irqsave.asm CHIP_ASRCS += ez80_irqcommon.asm diff --git a/arch/z80/src/z180/Make.defs b/arch/z80/src/z180/Make.defs index cd68793f6b3..61aab00c95d 100644 --- a/arch/z80/src/z180/Make.defs +++ b/arch/z80/src/z180/Make.defs @@ -30,9 +30,9 @@ endif CMN_CSRCS = z80_allocateheap.c z80_createstack.c z80_doirq.c CMN_CSRCS += z80_exit.c z80_interruptcontext.c z80_idle.c -CMN_CSRCS += z80_initialize.c z80_mdelay.c z80_nputs.c +CMN_CSRCS += z80_initialize.c z80_nputs.c CMN_CSRCS += z80_releasestack.c z80_stackframe.c z80_switchcontext.c -CMN_CSRCS += z80_udelay.c z80_usestack.c +CMN_CSRCS += z80_usestack.c CHIP_ASRCS = z180_restoreusercontext.asm z180_saveusercontext.asm CHIP_ASRCS += z180_vectcommon.asm diff --git a/arch/z80/src/z8/Make.defs b/arch/z80/src/z8/Make.defs index 383ef92bb27..299b0b9a3e7 100644 --- a/arch/z80/src/z8/Make.defs +++ b/arch/z80/src/z8/Make.defs @@ -24,9 +24,9 @@ HEAD_SSRC = z8_head.S CMN_CSRCS = z80_allocateheap.c z80_createstack.c z80_doirq.c CMN_CSRCS += z80_exit.c z80_idle.c z80_interruptcontext.c -CMN_CSRCS += z80_initialize.c z80_mdelay.c z80_nputs.c +CMN_CSRCS += z80_initialize.c z80_nputs.c CMN_CSRCS += z80_releasestack.c z80_switchcontext.c -CMN_CSRCS += z80_stackframe.c z80_udelay.c z80_usestack.c +CMN_CSRCS += z80_stackframe.c z80_usestack.c CHIP_SSRCS = z8_vector.S z8_saveusercontext.S z8_restorecontext.S CHIP_CSRCS = z8_initialstate.c z8_irq.c z8_saveirqcontext.c diff --git a/arch/z80/src/z80/Make.defs b/arch/z80/src/z80/Make.defs index 8555cf59ee9..0152299e47a 100644 --- a/arch/z80/src/z80/Make.defs +++ b/arch/z80/src/z80/Make.defs @@ -30,9 +30,9 @@ endif CMN_CSRCS = z80_allocateheap.c z80_createstack.c z80_doirq.c CMN_CSRCS += z80_exit.c z80_initialize.c z80_interruptcontext.c -CMN_CSRCS += z80_idle.c z80_mdelay.c z80_releasestack.c +CMN_CSRCS += z80_idle.c z80_releasestack.c CMN_CSRCS += z80_switchcontext.c z80_stackframe.c -CMN_CSRCS += z80_udelay.c z80_usestack.c +CMN_CSRCS += z80_usestack.c CHIP_ASRCS = z80_saveusercontext.asm z80_restoreusercontext.asm diff --git a/drivers/timers/arch_alarm.c b/drivers/timers/arch_alarm.c index 8133ec0ff85..35512cada33 100644 --- a/drivers/timers/arch_alarm.c +++ b/drivers/timers/arch_alarm.c @@ -30,14 +30,6 @@ #include #include -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define CONFIG_BOARD_LOOPSPER100USEC ((CONFIG_BOARD_LOOPSPERMSEC+5)/10) -#define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) -#define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) - /**************************************************************************** * Private Data ****************************************************************************/ @@ -52,53 +44,6 @@ static clock_t g_current_tick; * Private Functions ****************************************************************************/ -static void udelay_coarse(useconds_t microseconds) -{ - volatile int i; - - /* We'll do this a little at a time because we expect that the - * CONFIG_BOARD_LOOPSPERUSEC is very inaccurate during to truncation in - * the divisions of its calculation. We'll use the largest values that - * we can in order to prevent significant error buildup in the loops. - */ - - while (microseconds > 1000) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERMSEC; i++) - { - } - - microseconds -= 1000; - } - - while (microseconds > 100) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER100USEC; i++) - { - } - - microseconds -= 100; - } - - while (microseconds > 10) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPER10USEC; i++) - { - } - - microseconds -= 10; - } - - while (microseconds > 0) - { - for (i = 0; i < CONFIG_BOARD_LOOPSPERUSEC; i++) - { - } - - microseconds--; - } -} - static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower, FAR void *arg) { @@ -382,47 +327,3 @@ void up_perf_convert(clock_t elapsed, FAR struct timespec *ts) clock_nsec2time(ts, elapsed); } #endif /* CONFIG_ARCH_PERF_EVENTS */ - -/**************************************************************************** - * Name: up_mdelay - * - * Description: - * Delay inline for the requested number of milliseconds. - * *** NOT multi-tasking friendly *** - * - ****************************************************************************/ - -void weak_function up_mdelay(unsigned int milliseconds) -{ - up_udelay(USEC_PER_MSEC * milliseconds); -} - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. - * - * *** NOT multi-tasking friendly *** - * - ****************************************************************************/ - -void weak_function up_udelay(useconds_t microseconds) -{ - up_ndelay(NSEC_PER_USEC * microseconds); -} - -/**************************************************************************** - * Name: up_ndelay - * - * Description: - * Delay inline for the requested number of nanoseconds. - * - * *** NOT multi-tasking friendly *** - * - ****************************************************************************/ - -void weak_function up_ndelay(unsigned long nanoseconds) -{ - udelay_coarse((nanoseconds + NSEC_PER_USEC - 1) / NSEC_PER_USEC); -} diff --git a/sched/clock/CMakeLists.txt b/sched/clock/CMakeLists.txt index 6df843b2ef4..c2a12c8b167 100644 --- a/sched/clock/CMakeLists.txt +++ b/sched/clock/CMakeLists.txt @@ -30,6 +30,14 @@ set(SRCS clock_systime_timespec.c clock_perf.c) +# Unless a driver with a more accurate version of up_*delay is enabled, always +# include the base delay definition (busy-loop) as a minimum-viable product. We +# don't want the weak references to conflict. + +if(NOT CONFIG_TIMER_ARCH) + list(APPEND SRCS delay.c) +endif() + if(CONFIG_CLOCK_TIMEKEEPING) list(APPEND SRCS clock_timekeeping.c) endif() diff --git a/sched/clock/Make.defs b/sched/clock/Make.defs index 757c983f904..f0d281de23b 100644 --- a/sched/clock/Make.defs +++ b/sched/clock/Make.defs @@ -24,6 +24,14 @@ CSRCS += clock.c clock_initialize.c clock_settime.c clock_gettime.c CSRCS += clock_systime_ticks.c clock_systime_timespec.c CSRCS += clock_perf.c clock_realtime2absticks.c +# Unless a driver with a more accurate version of up_*delay is enabled, always +# include the base delay definition (busy-loop) as a minimum-viable product. We +# don't want the weak references to conflict. + +ifneq ($(CONFIG_TIMER_ARCH),y) + CSRCS += delay.c +endif + ifeq ($(CONFIG_CLOCK_TIMEKEEPING),y) CSRCS += clock_timekeeping.c endif diff --git a/arch/sparc/src/common/sparc_udelay.c b/sched/clock/delay.c similarity index 63% rename from arch/sparc/src/common/sparc_udelay.c rename to sched/clock/delay.c index a973493dc27..bf65177307f 100644 --- a/arch/sparc/src/common/sparc_udelay.c +++ b/sched/clock/delay.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/sparc/src/common/sparc_udelay.c + * sched/clock/delay.c * * SPDX-License-Identifier: Apache-2.0 * @@ -20,12 +20,36 @@ * ****************************************************************************/ +/* NOTE: This file contains the default implementation of `up_*delay` + * functions, which perform delays by busy-waiting in a for-loop. This + * functions do not work correctly unless the value + * `CONFIG_BOARD_LOOPSPERMSEC` is configured to the correct value for the + * given board. Its value should be how many loops approximately add up to + * one millisecond of delay. + * + * All one needs to do to override the implementation is override + * `up_udelay`. `up_mdelay` and `up_ndelay` implementations are both + * dependent on `up_udelay`. If you want them to be independent, you can + * also override each `up_*delay` function separately. + * + * WARNING: These functions are not accurate. If the scheduler suspends a + * process in the middle of performing a busy-wait for say, 10ms, and then + * starts it running again, the process will have waited whatever duration + * the busy-wait was meant to be, plus those 10ms. Thus, these functions + * should really only be used in situations where there is no better + * alternative. + * + * The definitions of these functions are 'weak', so if another file linked + * into the binary provides an alternate definition of these functions, that + * definition is what will be used. + */ + /**************************************************************************** * Included Files ****************************************************************************/ #include -#include + #include /**************************************************************************** @@ -36,43 +60,11 @@ #define CONFIG_BOARD_LOOPSPER10USEC ((CONFIG_BOARD_LOOPSPERMSEC+50)/100) #define CONFIG_BOARD_LOOPSPERUSEC ((CONFIG_BOARD_LOOPSPERMSEC+500)/1000) -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: up_udelay - * - * Description: - * Delay inline for the requested number of microseconds. NOTE: Because - * of all of the setup, several microseconds will be lost before the actual - * timing loop begins. Thus, the delay will always be a few microseconds - * longer than requested. - * - * *** NOT multi-tasking friendly *** - * - * ASSUMPTIONS: - * The setting CONFIG_BOARD_LOOPSPERMSEC has been calibrated - * - ****************************************************************************/ - -void up_udelay(useconds_t microseconds) +static void udelay_coarse(useconds_t microseconds) { volatile int i; @@ -119,3 +111,50 @@ void up_udelay(useconds_t microseconds) } } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_mdelay + * + * Description: + * Delay inline for the requested number of milliseconds. + * *** NOT multi-tasking friendly *** + * + ****************************************************************************/ + +void weak_function up_mdelay(unsigned int milliseconds) +{ + up_udelay(USEC_PER_MSEC * milliseconds); +} + +/**************************************************************************** + * Name: up_udelay + * + * Description: + * Delay inline for the requested number of microseconds. + * + * *** NOT multi-tasking friendly *** + * + ****************************************************************************/ + +void weak_function up_udelay(useconds_t microseconds) +{ + udelay_coarse(microseconds); +} + +/**************************************************************************** + * Name: up_ndelay + * + * Description: + * Delay inline for the requested number of nanoseconds. + * + * *** NOT multi-tasking friendly *** + * + ****************************************************************************/ + +void weak_function up_ndelay(unsigned long nanoseconds) +{ + up_udelay((nanoseconds + NSEC_PER_USEC - 1) / NSEC_PER_USEC); +}