From 83bc1c97c33fe27412adc2f01fa4e3711b8a1da7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 14 Feb 2016 16:11:25 -0600 Subject: [PATCH] Rename irqsave() and irqrestore() to up_irq_save() and up_irq_restore() --- arch/Kconfig | 2 +- arch/README.txt | 13 +++++++--- arch/arm/include/arm/irq.h | 15 ++++++++--- arch/arm/include/armv6-m/irq.h | 17 ++++++++++--- arch/arm/include/armv7-a/irq.h | 13 ++++++++-- arch/arm/include/armv7-m/irq.h | 17 ++++++++++--- arch/arm/include/armv7-r/irq.h | 13 ++++++++-- arch/arm/include/efm32/chip.h | 2 +- arch/arm/include/irq.h | 2 +- arch/arm/include/kinetis/chip.h | 2 +- arch/arm/include/lpc11xx/chip.h | 2 +- arch/arm/include/lpc17xx/chip.h | 2 +- arch/arm/include/lpc43xx/chip.h | 2 +- arch/arm/include/sam34/chip.h | 2 +- arch/arm/include/samv7/chip.h | 2 +- arch/arm/include/stm32/chip.h | 2 +- arch/arm/include/stm32f7/chip.h | 2 +- arch/arm/include/tiva/chip.h | 2 +- arch/arm/include/types.h | 4 +-- arch/arm/src/arm/up_assert.c | 2 +- arch/arm/src/arm/up_sigdeliver.c | 4 +-- arch/arm/src/armv6-m/up_assert.c | 2 +- arch/arm/src/armv6-m/up_hardfault.c | 2 +- arch/arm/src/armv6-m/up_sigdeliver.c | 4 +-- arch/arm/src/armv7-a/arm_assert.c | 2 +- arch/arm/src/armv7-a/arm_sigdeliver.c | 4 +-- arch/arm/src/armv7-m/up_assert.c | 2 +- arch/arm/src/armv7-m/up_hardfault.c | 2 +- arch/arm/src/armv7-m/up_memfault.c | 2 +- arch/arm/src/armv7-m/up_sigdeliver.c | 6 ++--- arch/arm/src/armv7-r/arm_assert.c | 2 +- arch/arm/src/armv7-r/arm_sigdeliver.c | 4 +-- arch/arm/src/c5471/c5471_irq.c | 2 +- arch/arm/src/calypso/calypso_irq.c | 2 +- arch/arm/src/common/up_exit.c | 2 +- arch/arm/src/dm320/dm320_irq.c | 2 +- arch/arm/src/efm32/efm32_irq.c | 12 ++++----- arch/arm/src/imx/imx_irq.c | 2 +- arch/arm/src/kinetis/kinetis_irq.c | 12 ++++----- arch/arm/src/kl/kl_irq.c | 6 ++--- arch/arm/src/lpc11xx/lpc11_irq.c | 6 ++--- arch/arm/src/lpc17xx/lpc17_irq.c | 12 ++++----- arch/arm/src/lpc214x/lpc214x_irq.c | 2 +- arch/arm/src/lpc2378/lpc23xx_irq.c | 2 +- arch/arm/src/lpc31xx/lpc31_irq.c | 2 +- arch/arm/src/lpc43xx/lpc43_irq.c | 12 ++++----- arch/arm/src/moxart/moxart_irq.c | 2 +- arch/arm/src/nuc1xx/nuc_irq.c | 6 ++--- arch/arm/src/sam34/sam_irq.c | 12 ++++----- arch/arm/src/samdl/sam_irq.c | 6 ++--- arch/arm/src/samv7/sam_irq.c | 12 ++++----- arch/arm/src/stm32/stm32_irq.c | 12 ++++----- arch/arm/src/stm32f7/stm32_irq.c | 12 ++++----- arch/arm/src/str71x/str71x_irq.c | 2 +- arch/arm/src/tiva/tiva_irq.c | 12 ++++----- arch/avr/include/avr/irq.h | 13 ++++++++-- arch/avr/include/avr/types.h | 2 +- arch/avr/include/avr32/irq.h | 13 ++++++++-- arch/avr/include/avr32/types.h | 2 +- arch/avr/include/irq.h | 2 +- arch/avr/src/at32uc3/at32uc3_irq.c | 4 +-- arch/avr/src/avr/up_irq.c | 2 +- arch/avr/src/avr/up_sigdeliver.c | 4 +-- arch/avr/src/avr32/up_sigdeliver.c | 4 +-- arch/avr/src/common/up_assert.c | 2 +- arch/avr/src/common/up_exit.c | 2 +- arch/hc/include/hc12/irq.h | 13 ++++++++-- arch/hc/include/hc12/types.h | 2 +- arch/hc/include/hcs12/irq.h | 19 ++++++++++---- arch/hc/include/hcs12/types.h | 2 +- arch/hc/include/irq.h | 2 +- arch/hc/src/common/up_exit.c | 2 +- arch/hc/src/m9s12/m9s12_assert.c | 2 +- arch/hc/src/m9s12/m9s12_irq.c | 2 +- arch/mips/include/irq.h | 2 +- arch/mips/include/mips32/irq.h | 22 ++++++++++++---- arch/mips/include/types.h | 2 +- arch/mips/src/common/up_exit.c | 2 +- arch/mips/src/mips32/up_assert.c | 2 +- arch/mips/src/mips32/up_irq.c | 10 ++++---- arch/mips/src/mips32/up_sigdeliver.c | 4 +-- arch/mips/src/pic32mx/pic32mx-irq.c | 4 +-- arch/mips/src/pic32mz/pic32mz-irq.c | 4 +-- arch/rgmp/include/irq.h | 36 ++++++++++++++++++--------- arch/rgmp/include/types.h | 2 +- arch/sh/include/m16c/irq.h | 13 ++++++++-- arch/sh/include/m16c/types.h | 2 +- arch/sh/include/sh1/irq.h | 4 +-- arch/sh/include/sh1/types.h | 2 +- arch/sh/src/common/up_assert.c | 2 +- arch/sh/src/common/up_exit.c | 2 +- arch/sh/src/m16c/m16c_irq.c | 4 +-- arch/sh/src/m16c/m16c_sigdeliver.c | 4 +-- arch/sh/src/sh1/sh1_sigdeliver.c | 4 +-- arch/sim/include/irq.h | 14 +++++++++-- arch/sim/include/types.h | 2 +- arch/x86/include/i486/irq.h | 13 ++++++++-- arch/x86/include/i486/types.h | 2 +- arch/x86/include/irq.h | 2 +- arch/x86/src/common/up_assert.c | 2 +- arch/x86/src/common/up_exit.c | 2 +- arch/x86/src/i486/up_irq.c | 2 +- arch/x86/src/i486/up_sigdeliver.c | 4 +-- arch/z16/include/types.h | 2 +- arch/z16/include/z16f/irq.h | 18 +++++++++----- arch/z16/src/common/up_assert.c | 2 +- arch/z16/src/common/up_exit.c | 2 +- arch/z16/src/common/up_sigdeliver.c | 2 +- arch/z80/include/ez80/irq.h | 13 ++++++++-- arch/z80/include/ez80/types.h | 2 +- arch/z80/include/z180/irq.h | 13 ++++++++-- arch/z80/include/z180/types.h | 2 +- arch/z80/include/z8/irq.h | 13 ++++++++-- arch/z80/include/z8/types.h | 2 +- arch/z80/include/z80/irq.h | 17 ++++++++++--- arch/z80/include/z80/types.h | 2 +- arch/z80/src/common/up_assert.c | 2 +- arch/z80/src/common/up_exit.c | 2 +- arch/z80/src/ez80/Make.defs | 2 +- arch/z80/src/ez80/ez80_irq.c | 4 +-- arch/z80/src/ez80/ez80_irqsave.asm | 14 +++++------ arch/z80/src/ez80/ez80_sigdeliver.c | 4 +-- arch/z80/src/z180/z180_irq.c | 10 ++++---- arch/z80/src/z180/z180_sigdeliver.c | 4 +-- arch/z80/src/z8/z8_irq.c | 10 ++++---- arch/z80/src/z8/z8_sigdeliver.c | 4 +-- arch/z80/src/z80/z80_irq.c | 8 +++--- arch/z80/src/z80/z80_sigdeliver.c | 4 +-- 128 files changed, 455 insertions(+), 273 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 6ef30f6211..d093a7d698 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -719,7 +719,7 @@ config ARCH_INT_DISABLEALL back into the game" via a PendSV interrupt). In the normal course of things, interrupts must occasionally be - disabled using the irqsave() inline function to prevent contention + disabled using the up_irq_save() inline function to prevent contention in use of resources that may be shared between interrupt level and non-interrupt level logic. Now the question arises, if ARCH_HIPRI_INTERRUPT, do we disable all interrupts (except SVCall), diff --git a/arch/README.txt b/arch/README.txt index e074d6983c..df34133df9 100644 --- a/arch/README.txt +++ b/arch/README.txt @@ -107,10 +107,17 @@ include/irq.h - struct xcptcontext. This structures represents the saved context of a thread. - - irqstate_t irqsave(void) -- Used to disable all interrupts. + - irqstate_t up_irq_save(void) -- Used to disable all interrupts. - - void irqrestore(irqstate_t flags) -- Used to restore interrupt - enables to the same state as before irqsave was called. + - void upirq_restore(irqstate_t flags) -- Used to restore interrupt + enables to the same state as before up_irq_save was called. + + NOTE: These interfaces are not available to application code but can + only be used withint the operating system code. And, in general, + these functions should *never* be called directly, not unless you + know absolutely well what you are doing. Rather you shoudl typically + use the wrapper functions enter_critical_section() and leave_critical_section() + as prototyped in include/nuttx/irq.h. This file must also define NR_IRQS, the total number of IRQs supported by the board. diff --git a/arch/arm/include/arm/irq.h b/arch/arm/include/arm/irq.h index e4501accb1..37e5b93640 100644 --- a/arch/arm/include/arm/irq.h +++ b/arch/arm/include/arm/irq.h @@ -175,9 +175,18 @@ struct xcptcontext #ifndef __ASSEMBLY__ -/* Save the current interrupt enable state & disable IRQs */ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ -static inline irqstate_t irqsave(void) + /* Save the current interrupt enable state & disable IRQs. */ + +static inline irqstate_t up_irq_save(void) { unsigned int flags; unsigned int temp; @@ -194,7 +203,7 @@ static inline irqstate_t irqsave(void) /* Restore saved IRQ & FIQ state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { __asm__ __volatile__ ( diff --git a/arch/arm/include/armv6-m/irq.h b/arch/arm/include/armv6-m/irq.h index ca494afb91..c04d5cae76 100644 --- a/arch/arm/include/armv6-m/irq.h +++ b/arch/arm/include/armv6-m/irq.h @@ -213,6 +213,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Get/set the PRIMASK register */ static inline uint8_t getprimask(void) inline_function; @@ -250,8 +259,8 @@ static inline void irqdisable(void) /* Save the current primask state & disable IRQs */ -static inline irqstate_t irqsave(void) inline_function; -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) inline_function; +static inline irqstate_t up_irq_save(void) { unsigned short primask; @@ -280,8 +289,8 @@ static inline void irqenable(void) /* Restore saved primask state */ -static inline void irqrestore(irqstate_t flags) inline_function; -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) inline_function; +static inline void up_irq_restore(irqstate_t flags) { /* If bit 0 of the primask is 0, then we need to restore * interrupts. diff --git a/arch/arm/include/armv7-a/irq.h b/arch/arm/include/armv7-a/irq.h index e582ebd008..8a9d2be89a 100644 --- a/arch/arm/include/armv7-a/irq.h +++ b/arch/arm/include/armv7-a/irq.h @@ -312,6 +312,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Return the current IRQ state */ static inline irqstate_t irqstate(void) @@ -331,7 +340,7 @@ static inline irqstate_t irqstate(void) /* Disable IRQs and return the previous IRQ state */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { unsigned int cpsr; @@ -373,7 +382,7 @@ static inline irqstate_t irqenable(void) /* Restore saved IRQ & FIQ state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { __asm__ __volatile__ ( diff --git a/arch/arm/include/armv7-m/irq.h b/arch/arm/include/armv7-m/irq.h index 385d24ce63..d4faeaa4e1 100644 --- a/arch/arm/include/armv7-m/irq.h +++ b/arch/arm/include/armv7-m/irq.h @@ -176,6 +176,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Get/set the PRIMASK register */ static inline uint8_t getprimask(void) inline_function; @@ -249,8 +258,8 @@ static inline void irqdisable(void) /* Save the current primask state & disable IRQs */ -static inline irqstate_t irqsave(void) inline_function; -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) inline_function; +static inline irqstate_t up_irq_save(void) { #ifdef CONFIG_ARMV7M_USEBASEPRI @@ -289,8 +298,8 @@ static inline void irqenable(void) /* Restore saved primask state */ -static inline void irqrestore(irqstate_t flags) inline_function; -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) inline_function; +static inline void up_irq_restore(irqstate_t flags) { #ifdef CONFIG_ARMV7M_USEBASEPRI setbasepri((uint32_t)flags); diff --git a/arch/arm/include/armv7-r/irq.h b/arch/arm/include/armv7-r/irq.h index 7365e6648d..551979e719 100644 --- a/arch/arm/include/armv7-r/irq.h +++ b/arch/arm/include/armv7-r/irq.h @@ -312,6 +312,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Return the current IRQ state */ static inline irqstate_t irqstate(void) @@ -331,7 +340,7 @@ static inline irqstate_t irqstate(void) /* Disable IRQs and return the previous IRQ state */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { unsigned int cpsr; @@ -373,7 +382,7 @@ static inline irqstate_t irqenable(void) /* Restore saved IRQ & FIQ state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { __asm__ __volatile__ ( diff --git a/arch/arm/include/efm32/chip.h b/arch/arm/include/efm32/chip.h index f063daf7c4..2b73f7844f 100644 --- a/arch/arm/include/efm32/chip.h +++ b/arch/arm/include/efm32/chip.h @@ -93,7 +93,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/irq.h b/arch/arm/include/irq.h index 0a4ad1bc3e..99d255a37a 100644 --- a/arch/arm/include/irq.h +++ b/arch/arm/include/irq.h @@ -53,7 +53,7 @@ #include /* Include ARM architecture-specific IRQ definitions (including register - * save structure and irqsave()/irqrestore() macros) + * save structure and up_irq_save()/up_irq_restore() functions) */ #if defined(CONFIG_ARCH_CORTEXA5) || defined(CONFIG_ARCH_CORTEXA8) diff --git a/arch/arm/include/kinetis/chip.h b/arch/arm/include/kinetis/chip.h index 83979b822f..dd8582e564 100644 --- a/arch/arm/include/kinetis/chip.h +++ b/arch/arm/include/kinetis/chip.h @@ -1021,7 +1021,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/lpc11xx/chip.h b/arch/arm/include/lpc11xx/chip.h index 4434463236..1c381df7d9 100644 --- a/arch/arm/include/lpc11xx/chip.h +++ b/arch/arm/include/lpc11xx/chip.h @@ -93,7 +93,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/lpc17xx/chip.h b/arch/arm/include/lpc17xx/chip.h index f03785e19a..5eebd0f7bf 100644 --- a/arch/arm/include/lpc17xx/chip.h +++ b/arch/arm/include/lpc17xx/chip.h @@ -389,7 +389,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/lpc43xx/chip.h b/arch/arm/include/lpc43xx/chip.h index 856dc96ccc..56db629293 100644 --- a/arch/arm/include/lpc43xx/chip.h +++ b/arch/arm/include/lpc43xx/chip.h @@ -678,7 +678,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/sam34/chip.h b/arch/arm/include/sam34/chip.h index 48e5afa67f..3bd3b42d51 100644 --- a/arch/arm/include/sam34/chip.h +++ b/arch/arm/include/sam34/chip.h @@ -901,7 +901,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/samv7/chip.h b/arch/arm/include/samv7/chip.h index ae5e5e59d9..2d52b3de8a 100644 --- a/arch/arm/include/samv7/chip.h +++ b/arch/arm/include/samv7/chip.h @@ -413,7 +413,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/stm32/chip.h b/arch/arm/include/stm32/chip.h index ed2aa1f227..56a0ba7943 100644 --- a/arch/arm/include/stm32/chip.h +++ b/arch/arm/include/stm32/chip.h @@ -2372,7 +2372,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/stm32f7/chip.h b/arch/arm/include/stm32f7/chip.h index 7a02cc4d65..372bd1143f 100644 --- a/arch/arm/include/stm32f7/chip.h +++ b/arch/arm/include/stm32f7/chip.h @@ -164,7 +164,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/tiva/chip.h b/arch/arm/include/tiva/chip.h index 5319ec282d..8e3085307f 100644 --- a/arch/arm/include/tiva/chip.h +++ b/arch/arm/include/tiva/chip.h @@ -343,7 +343,7 @@ * into the game" via a PendSV interrupt). * * In the normal course of things, interrupts must occasionally be disabled - * using the irqsave() inline function to prevent contention in use of + * using the up_irq_save() inline function to prevent contention in use of * resources that may be shared between interrupt level and non-interrupt * level logic. Now the question arises, if CONFIG_ARCH_HIPRI_INTERRUPT, * do we disable all interrupts (except SVCall), or do we only disable the diff --git a/arch/arm/include/types.h b/arch/arm/include/types.h index e0fc7c1c1d..ea0675d0e9 100644 --- a/arch/arm/include/types.h +++ b/arch/arm/include/types.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/include/types.h * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ typedef unsigned long long _uint64_t; typedef signed int _intptr_t; typedef unsigned int _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave(). For +/* This is the size of the interrupt state save returned by up_irq_save(). For * ARM, a 32 register value is returned, for the thumb2, Cortex-M3, the 16-bit * primask register value is returned, */ diff --git a/arch/arm/src/arm/up_assert.c b/arch/arm/src/arm/up_assert.c index 8d02552606..5c6ceea7a0 100644 --- a/arch/arm/src/arm/up_assert.c +++ b/arch/arm/src/arm/up_assert.c @@ -312,7 +312,7 @@ static void _up_assert(int errorcode) if (current_regs || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (; ; ) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/arm/src/arm/up_sigdeliver.c b/arch/arm/src/arm/up_sigdeliver.c index 0d881f05d4..c03511d4df 100644 --- a/arch/arm/src/arm/up_sigdeliver.c +++ b/arch/arm/src/arm/up_sigdeliver.c @@ -115,7 +115,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore(regs[REG_CPSR]); + up_irq_restore(regs[REG_CPSR]); /* Deliver the signals */ @@ -127,7 +127,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/arm/src/armv6-m/up_assert.c b/arch/arm/src/armv6-m/up_assert.c index a553da089b..d8aa9871f1 100644 --- a/arch/arm/src/armv6-m/up_assert.c +++ b/arch/arm/src/armv6-m/up_assert.c @@ -367,7 +367,7 @@ static void _up_assert(int errorcode) if (current_regs || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (; ; ) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/arm/src/armv6-m/up_hardfault.c b/arch/arm/src/armv6-m/up_hardfault.c index 2e77c853d7..55079571fb 100644 --- a/arch/arm/src/armv6-m/up_hardfault.c +++ b/arch/arm/src/armv6-m/up_hardfault.c @@ -148,7 +148,7 @@ int up_hardfault(int irq, FAR void *context) current_regs[REG_XPSR], current_regs[REG_PRIMASK]); #endif - (void)irqsave(); + (void)up_irq_save(); lldbg("PANIC!!! Hard fault\n"); PANIC(); return OK; /* Won't get here */ diff --git a/arch/arm/src/armv6-m/up_sigdeliver.c b/arch/arm/src/armv6-m/up_sigdeliver.c index 2b75e757dc..84b89542a2 100644 --- a/arch/arm/src/armv6-m/up_sigdeliver.c +++ b/arch/arm/src/armv6-m/up_sigdeliver.c @@ -124,7 +124,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore((uint8_t)regs[REG_PRIMASK]); + up_irq_restore((uint8_t)regs[REG_PRIMASK]); /* Deliver the signal */ @@ -136,7 +136,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c index 1f2dbb70f5..0b1e27e068 100644 --- a/arch/arm/src/armv7-a/arm_assert.c +++ b/arch/arm/src/armv7-a/arm_assert.c @@ -363,7 +363,7 @@ static void _up_assert(int errorcode) if (current_regs || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (; ; ) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index 4cfcf3ada1..32f1e0b40d 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -103,7 +103,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore(regs[REG_CPSR]); + up_irq_restore(regs[REG_CPSR]); /* Deliver the signals */ @@ -115,7 +115,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/arm/src/armv7-m/up_assert.c b/arch/arm/src/armv7-m/up_assert.c index 1f72ae889c..2e3abeb2aa 100644 --- a/arch/arm/src/armv7-m/up_assert.c +++ b/arch/arm/src/armv7-m/up_assert.c @@ -376,7 +376,7 @@ static void _up_assert(int errorcode) if (current_regs || (this_task())->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (; ; ) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/arm/src/armv7-m/up_hardfault.c b/arch/arm/src/armv7-m/up_hardfault.c index 31ab3d9b14..4a18658cfc 100644 --- a/arch/arm/src/armv7-m/up_hardfault.c +++ b/arch/arm/src/armv7-m/up_hardfault.c @@ -178,7 +178,7 @@ int up_hardfault(int irq, FAR void *context) # endif #endif - (void)irqsave(); + (void)up_irq_save(); lldbg("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS)); PANIC(); return OK; diff --git a/arch/arm/src/armv7-m/up_memfault.c b/arch/arm/src/armv7-m/up_memfault.c index 7ac5cd0884..11d0c2eee3 100644 --- a/arch/arm/src/armv7-m/up_memfault.c +++ b/arch/arm/src/armv7-m/up_memfault.c @@ -91,7 +91,7 @@ int up_memfault(int irq, FAR void *context) { /* Dump some memory management fault info */ - (void)irqsave(); + (void)up_irq_save(); lldbg("PANIC!!! Memory Management Fault:\n"); mfdbg(" IRQ: %d context: %p\n", irq, regs); lldbg(" CFAULTS: %08x MMFAR: %08x\n", diff --git a/arch/arm/src/armv7-m/up_sigdeliver.c b/arch/arm/src/armv7-m/up_sigdeliver.c index 50eba20c90..a3e4166dad 100644 --- a/arch/arm/src/armv7-m/up_sigdeliver.c +++ b/arch/arm/src/armv7-m/up_sigdeliver.c @@ -124,9 +124,9 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ #ifdef CONFIG_ARMV7M_USEBASEPRI - irqrestore((uint8_t)regs[REG_BASEPRI]); + up_irq_restore((uint8_t)regs[REG_BASEPRI]); #else - irqrestore((uint16_t)regs[REG_PRIMASK]); + up_irq_restore((uint16_t)regs[REG_PRIMASK]); #endif /* Deliver the signal */ @@ -139,7 +139,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c index fce32a4a95..3abfd2afc1 100644 --- a/arch/arm/src/armv7-r/arm_assert.c +++ b/arch/arm/src/armv7-r/arm_assert.c @@ -363,7 +363,7 @@ static void _up_assert(int errorcode) if (current_regs || (this_task())->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (; ; ) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/arm/src/armv7-r/arm_sigdeliver.c b/arch/arm/src/armv7-r/arm_sigdeliver.c index 887bd33c61..f638b35bfd 100644 --- a/arch/arm/src/armv7-r/arm_sigdeliver.c +++ b/arch/arm/src/armv7-r/arm_sigdeliver.c @@ -103,7 +103,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore(regs[REG_CPSR]); + up_irq_restore(regs[REG_CPSR]); /* Deliver the signals */ @@ -115,7 +115,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/arm/src/c5471/c5471_irq.c b/arch/arm/src/c5471/c5471_irq.c index 57485fc393..c57d218d2f 100644 --- a/arch/arm/src/c5471/c5471_irq.c +++ b/arch/arm/src/c5471/c5471_irq.c @@ -179,7 +179,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/calypso/calypso_irq.c b/arch/arm/src/calypso/calypso_irq.c index 091110e0fb..f77b52ab7e 100644 --- a/arch/arm/src/calypso/calypso_irq.c +++ b/arch/arm/src/calypso/calypso_irq.c @@ -223,7 +223,7 @@ void up_irqinitialize(void) /* Enable interrupts globally to the ARM core */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index f521cf4e3d..57137a60de 100644 --- a/arch/arm/src/common/up_exit.c +++ b/arch/arm/src/common/up_exit.c @@ -136,7 +136,7 @@ void _exit(int status) * task is started. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", this_task()); diff --git a/arch/arm/src/dm320/dm320_irq.c b/arch/arm/src/dm320/dm320_irq.c index 99274c3fbf..7c8edc13d7 100644 --- a/arch/arm/src/dm320/dm320_irq.c +++ b/arch/arm/src/dm320/dm320_irq.c @@ -116,7 +116,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c index 5c87e8a336..9409e71c10 100644 --- a/arch/arm/src/efm32/efm32_irq.c +++ b/arch/arm/src/efm32/efm32_irq.c @@ -165,7 +165,7 @@ static void efm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int efm32_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -173,7 +173,7 @@ static int efm32_nmi(int irq, FAR void *context) static int efm32_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -181,7 +181,7 @@ static int efm32_busfault(int irq, FAR void *context) static int efm32_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -189,7 +189,7 @@ static int efm32_usagefault(int irq, FAR void *context) static int efm32_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -197,7 +197,7 @@ static int efm32_pendsv(int irq, FAR void *context) static int efm32_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -205,7 +205,7 @@ static int efm32_dbgmonitor(int irq, FAR void *context) static int efm32_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/imx/imx_irq.c b/arch/arm/src/imx/imx_irq.c index 43f35caf12..9de722f445 100644 --- a/arch/arm/src/imx/imx_irq.c +++ b/arch/arm/src/imx/imx_irq.c @@ -100,7 +100,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c index 49575a6b1b..f482a2c0ca 100644 --- a/arch/arm/src/kinetis/kinetis_irq.c +++ b/arch/arm/src/kinetis/kinetis_irq.c @@ -169,7 +169,7 @@ static void kinetis_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int kinetis_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -177,7 +177,7 @@ static int kinetis_nmi(int irq, FAR void *context) static int kinetis_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault recived\n"); PANIC(); return 0; @@ -185,7 +185,7 @@ static int kinetis_busfault(int irq, FAR void *context) static int kinetis_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -193,7 +193,7 @@ static int kinetis_usagefault(int irq, FAR void *context) static int kinetis_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -201,7 +201,7 @@ static int kinetis_pendsv(int irq, FAR void *context) static int kinetis_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -209,7 +209,7 @@ static int kinetis_dbgmonitor(int irq, FAR void *context) static int kinetis_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/kl/kl_irq.c b/arch/arm/src/kl/kl_irq.c index 9c5ca2e6a6..1fd9f81e79 100644 --- a/arch/arm/src/kl/kl_irq.c +++ b/arch/arm/src/kl/kl_irq.c @@ -134,7 +134,7 @@ static void kl_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int kl_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -142,7 +142,7 @@ static int kl_nmi(int irq, FAR void *context) static int kl_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -150,7 +150,7 @@ static int kl_pendsv(int irq, FAR void *context) static int kl_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/lpc11xx/lpc11_irq.c b/arch/arm/src/lpc11xx/lpc11_irq.c index 6d3761e457..fe9eccadc2 100644 --- a/arch/arm/src/lpc11xx/lpc11_irq.c +++ b/arch/arm/src/lpc11xx/lpc11_irq.c @@ -130,7 +130,7 @@ static void lpc11_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int lpc11_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -138,7 +138,7 @@ static int lpc11_nmi(int irq, FAR void *context) static int lpc11_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -146,7 +146,7 @@ static int lpc11_pendsv(int irq, FAR void *context) static int lpc11_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/lpc17xx/lpc17_irq.c b/arch/arm/src/lpc17xx/lpc17_irq.c index 295f635943..f4034d2914 100644 --- a/arch/arm/src/lpc17xx/lpc17_irq.c +++ b/arch/arm/src/lpc17xx/lpc17_irq.c @@ -147,7 +147,7 @@ static void lpc17_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int lpc17_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -155,7 +155,7 @@ static int lpc17_nmi(int irq, FAR void *context) static int lpc17_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault recived\n"); PANIC(); return 0; @@ -163,7 +163,7 @@ static int lpc17_busfault(int irq, FAR void *context) static int lpc17_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -171,7 +171,7 @@ static int lpc17_usagefault(int irq, FAR void *context) static int lpc17_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -179,7 +179,7 @@ static int lpc17_pendsv(int irq, FAR void *context) static int lpc17_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -187,7 +187,7 @@ static int lpc17_dbgmonitor(int irq, FAR void *context) static int lpc17_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/lpc214x/lpc214x_irq.c b/arch/arm/src/lpc214x/lpc214x_irq.c index 6542243245..db4dec1c83 100644 --- a/arch/arm/src/lpc214x/lpc214x_irq.c +++ b/arch/arm/src/lpc214x/lpc214x_irq.c @@ -111,7 +111,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/lpc2378/lpc23xx_irq.c b/arch/arm/src/lpc2378/lpc23xx_irq.c index 33524c3b1c..bb90432919 100644 --- a/arch/arm/src/lpc2378/lpc23xx_irq.c +++ b/arch/arm/src/lpc2378/lpc23xx_irq.c @@ -111,7 +111,7 @@ void up_irqinitialize(void) /* Enable global ARM interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/lpc31xx/lpc31_irq.c b/arch/arm/src/lpc31xx/lpc31_irq.c index f95f711c4d..ce57e8bd0f 100644 --- a/arch/arm/src/lpc31xx/lpc31_irq.c +++ b/arch/arm/src/lpc31xx/lpc31_irq.c @@ -124,7 +124,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c index 7cd7f7d921..6d6941c512 100644 --- a/arch/arm/src/lpc43xx/lpc43_irq.c +++ b/arch/arm/src/lpc43xx/lpc43_irq.c @@ -156,7 +156,7 @@ static void lpc43_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int lpc43_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -164,7 +164,7 @@ static int lpc43_nmi(int irq, FAR void *context) static int lpc43_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault recived\n"); PANIC(); return 0; @@ -172,7 +172,7 @@ static int lpc43_busfault(int irq, FAR void *context) static int lpc43_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -180,7 +180,7 @@ static int lpc43_usagefault(int irq, FAR void *context) static int lpc43_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -188,7 +188,7 @@ static int lpc43_pendsv(int irq, FAR void *context) static int lpc43_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -196,7 +196,7 @@ static int lpc43_dbgmonitor(int irq, FAR void *context) static int lpc43_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/moxart/moxart_irq.c b/arch/arm/src/moxart/moxart_irq.c index 044bca0734..cc571f0394 100644 --- a/arch/arm/src/moxart/moxart_irq.c +++ b/arch/arm/src/moxart/moxart_irq.c @@ -150,7 +150,7 @@ void up_irqinitialize(void) #endif #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/nuc1xx/nuc_irq.c b/arch/arm/src/nuc1xx/nuc_irq.c index a385eb1fb3..62610622e3 100644 --- a/arch/arm/src/nuc1xx/nuc_irq.c +++ b/arch/arm/src/nuc1xx/nuc_irq.c @@ -134,7 +134,7 @@ static void nuc_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int nuc_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -142,7 +142,7 @@ static int nuc_nmi(int irq, FAR void *context) static int nuc_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -150,7 +150,7 @@ static int nuc_pendsv(int irq, FAR void *context) static int nuc_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c index 0d533bc0af..57913ef58f 100644 --- a/arch/arm/src/sam34/sam_irq.c +++ b/arch/arm/src/sam34/sam_irq.c @@ -172,7 +172,7 @@ static void sam_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int sam_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -180,7 +180,7 @@ static int sam_nmi(int irq, FAR void *context) static int sam_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -188,7 +188,7 @@ static int sam_busfault(int irq, FAR void *context) static int sam_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -196,7 +196,7 @@ static int sam_usagefault(int irq, FAR void *context) static int sam_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -204,7 +204,7 @@ static int sam_pendsv(int irq, FAR void *context) static int sam_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -212,7 +212,7 @@ static int sam_dbgmonitor(int irq, FAR void *context) static int sam_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/samdl/sam_irq.c b/arch/arm/src/samdl/sam_irq.c index a68099a816..844ac21ce6 100644 --- a/arch/arm/src/samdl/sam_irq.c +++ b/arch/arm/src/samdl/sam_irq.c @@ -90,7 +90,7 @@ volatile uint32_t *current_regs; #ifdef CONFIG_DEBUG static int sam_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -98,7 +98,7 @@ static int sam_nmi(int irq, FAR void *context) static int sam_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -106,7 +106,7 @@ static int sam_pendsv(int irq, FAR void *context) static int sam_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/samv7/sam_irq.c b/arch/arm/src/samv7/sam_irq.c index a954c4c3bb..bac8885e80 100644 --- a/arch/arm/src/samv7/sam_irq.c +++ b/arch/arm/src/samv7/sam_irq.c @@ -172,7 +172,7 @@ static void sam_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int sam_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -180,7 +180,7 @@ static int sam_nmi(int irq, FAR void *context) static int sam_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -188,7 +188,7 @@ static int sam_busfault(int irq, FAR void *context) static int sam_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -196,7 +196,7 @@ static int sam_usagefault(int irq, FAR void *context) static int sam_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -204,7 +204,7 @@ static int sam_pendsv(int irq, FAR void *context) static int sam_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -212,7 +212,7 @@ static int sam_dbgmonitor(int irq, FAR void *context) static int sam_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c index 38259cca90..b1fa366231 100644 --- a/arch/arm/src/stm32/stm32_irq.c +++ b/arch/arm/src/stm32/stm32_irq.c @@ -153,7 +153,7 @@ static void stm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int stm32_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -161,7 +161,7 @@ static int stm32_nmi(int irq, FAR void *context) static int stm32_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -169,7 +169,7 @@ static int stm32_busfault(int irq, FAR void *context) static int stm32_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -177,7 +177,7 @@ static int stm32_usagefault(int irq, FAR void *context) static int stm32_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -185,7 +185,7 @@ static int stm32_pendsv(int irq, FAR void *context) static int stm32_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -193,7 +193,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context) static int stm32_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/stm32f7/stm32_irq.c b/arch/arm/src/stm32f7/stm32_irq.c index 32099b5d94..f175a6d9d7 100644 --- a/arch/arm/src/stm32f7/stm32_irq.c +++ b/arch/arm/src/stm32f7/stm32_irq.c @@ -184,7 +184,7 @@ static void stm32_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int stm32_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -192,7 +192,7 @@ static int stm32_nmi(int irq, FAR void *context) static int stm32_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -200,7 +200,7 @@ static int stm32_busfault(int irq, FAR void *context) static int stm32_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received: %08x\n", getreg32(NVIC_CFAULTS)); PANIC(); return 0; @@ -208,7 +208,7 @@ static int stm32_usagefault(int irq, FAR void *context) static int stm32_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -216,7 +216,7 @@ static int stm32_pendsv(int irq, FAR void *context) static int stm32_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -224,7 +224,7 @@ static int stm32_dbgmonitor(int irq, FAR void *context) static int stm32_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/arm/src/str71x/str71x_irq.c b/arch/arm/src/str71x/str71x_irq.c index 6871e84d2c..76b66921cc 100644 --- a/arch/arm/src/str71x/str71x_irq.c +++ b/arch/arm/src/str71x/str71x_irq.c @@ -98,7 +98,7 @@ void up_irqinitialize(void) /* Enable global ARM interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(SVC_MODE | PSR_F_BIT); + up_irq_restore(SVC_MODE | PSR_F_BIT); #endif } diff --git a/arch/arm/src/tiva/tiva_irq.c b/arch/arm/src/tiva/tiva_irq.c index 9a9b4c36f7..d5229a4d09 100644 --- a/arch/arm/src/tiva/tiva_irq.c +++ b/arch/arm/src/tiva/tiva_irq.c @@ -196,7 +196,7 @@ static void tiva_dumpnvic(const char *msg, int irq) #ifdef CONFIG_DEBUG static int tiva_nmi(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! NMI received\n"); PANIC(); return 0; @@ -204,7 +204,7 @@ static int tiva_nmi(int irq, FAR void *context) static int tiva_busfault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Bus fault recived\n"); PANIC(); return 0; @@ -212,7 +212,7 @@ static int tiva_busfault(int irq, FAR void *context) static int tiva_usagefault(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Usage fault received\n"); PANIC(); return 0; @@ -220,7 +220,7 @@ static int tiva_usagefault(int irq, FAR void *context) static int tiva_pendsv(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! PendSV received\n"); PANIC(); return 0; @@ -228,7 +228,7 @@ static int tiva_pendsv(int irq, FAR void *context) static int tiva_dbgmonitor(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Debug Monitor received\n"); PANIC(); return 0; @@ -236,7 +236,7 @@ static int tiva_dbgmonitor(int irq, FAR void *context) static int tiva_reserved(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); dbg("PANIC!!! Reserved interrupt\n"); PANIC(); return 0; diff --git a/arch/avr/include/avr/irq.h b/arch/avr/include/avr/irq.h index 9868e03fb5..2bafcd58bb 100644 --- a/arch/avr/include/avr/irq.h +++ b/arch/avr/include/avr/irq.h @@ -135,6 +135,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Read/write the SREG */ static inline irqstate_t getsreg(void) @@ -163,7 +172,7 @@ static inline void irqdisable() /* Save the current interrupt enable state & disable all interrupts */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { irqstate_t sreg; asm volatile @@ -177,7 +186,7 @@ static inline irqstate_t irqsave(void) /* Restore saved interrupt state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { asm volatile ("out __SREG__, %0" : : "r" (flags) : ); } diff --git a/arch/avr/include/avr/types.h b/arch/avr/include/avr/types.h index 4ea22aeafa..d256a85a76 100644 --- a/arch/avr/include/avr/types.h +++ b/arch/avr/include/avr/types.h @@ -86,7 +86,7 @@ typedef unsigned int _uintptr_t; typedef signed long _int_farptr_t; typedef unsigned long _uint_farptr_t; -/* This is the size of the interrupt state save returned by irqsave(). */ +/* This is the size of the interrupt state save returned by up_irq_save(). */ typedef unsigned char irqstate_t; diff --git a/arch/avr/include/avr32/irq.h b/arch/avr/include/avr32/irq.h index d44c91a64f..b08a8ce431 100644 --- a/arch/avr/include/avr32/irq.h +++ b/arch/avr/include/avr32/irq.h @@ -132,6 +132,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Read the AVR32 status register */ static inline uint32_t avr32_sr(void) @@ -160,7 +169,7 @@ static inline uint32_t avr32_evba(void) /* Save the current interrupt enable state & disable all interrupts */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { irqstate_t sr = (irqstate_t)avr32_sr(); __asm__ __volatile__ ( @@ -175,7 +184,7 @@ static inline irqstate_t irqsave(void) /* Restore saved interrupt state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { if ((flags & AVR32_SR_GM_MASK) == 0) { diff --git a/arch/avr/include/avr32/types.h b/arch/avr/include/avr32/types.h index 6a7c00b478..d3182876c9 100644 --- a/arch/avr/include/avr32/types.h +++ b/arch/avr/include/avr32/types.h @@ -81,7 +81,7 @@ typedef unsigned long long _uint64_t; typedef signed int _intptr_t; typedef unsigned int _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave(). */ +/* This is the size of the interrupt state save returned by up_irq_save(). */ typedef unsigned int irqstate_t; diff --git a/arch/avr/include/irq.h b/arch/avr/include/irq.h index 6fdfcb0124..3a8ecc632e 100644 --- a/arch/avr/include/irq.h +++ b/arch/avr/include/irq.h @@ -53,7 +53,7 @@ #include /* Include AVR architecture-specific IRQ definitions (including register - * save structure and irqsave()/irqrestore() macros + * save structure and up_irq_save()/up_irq_restore() functions). */ #ifdef CONFIG_ARCH_FAMILY_AVR32 diff --git a/arch/avr/src/at32uc3/at32uc3_irq.c b/arch/avr/src/at32uc3/at32uc3_irq.c index 342b796e54..702bb2a49c 100644 --- a/arch/avr/src/at32uc3/at32uc3_irq.c +++ b/arch/avr/src/at32uc3/at32uc3_irq.c @@ -176,7 +176,7 @@ static int up_getgrp(unsigned int irq) static int avr32_xcptn(int irq, FAR void *context) { - (void)irqsave(); + (void)up_irq_save(); lldbg("PANIC!!! Exception IRQ: %d\n", irq); PANIC(); return 0; @@ -240,7 +240,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(0); + up_irq_restore(0); #endif } diff --git a/arch/avr/src/avr/up_irq.c b/arch/avr/src/avr/up_irq.c index abe6f360c4..b647db6754 100644 --- a/arch/avr/src/avr/up_irq.c +++ b/arch/avr/src/avr/up_irq.c @@ -85,6 +85,6 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(getsreg() | (1 << SREG_I)); + up_irq_restore(getsreg() | (1 << SREG_I)); #endif } diff --git a/arch/avr/src/avr/up_sigdeliver.c b/arch/avr/src/avr/up_sigdeliver.c index 4a0035ef1b..e786cba00c 100644 --- a/arch/avr/src/avr/up_sigdeliver.c +++ b/arch/avr/src/avr/up_sigdeliver.c @@ -106,7 +106,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore(regs[REG_SREG]); + up_irq_restore(regs[REG_SREG]); /* Deliver the signals */ @@ -118,7 +118,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. This is an diff --git a/arch/avr/src/avr32/up_sigdeliver.c b/arch/avr/src/avr32/up_sigdeliver.c index 4c89306f83..883bec9742 100644 --- a/arch/avr/src/avr32/up_sigdeliver.c +++ b/arch/avr/src/avr32/up_sigdeliver.c @@ -106,7 +106,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore(regs[REG_SR]); + up_irq_restore(regs[REG_SR]); /* Deliver the signals */ @@ -118,7 +118,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. This is an diff --git a/arch/avr/src/common/up_assert.c b/arch/avr/src/common/up_assert.c index e3700d07a0..a98436b925 100644 --- a/arch/avr/src/common/up_assert.c +++ b/arch/avr/src/common/up_assert.c @@ -107,7 +107,7 @@ static void _up_assert(int errorcode) if (current_regs || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (; ; ) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index 0415783ff1..936a79d233 100644 --- a/arch/avr/src/common/up_exit.c +++ b/arch/avr/src/common/up_exit.c @@ -136,7 +136,7 @@ void _exit(int status) * task is started. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", this_task()); diff --git a/arch/hc/include/hc12/irq.h b/arch/hc/include/hc12/irq.h index 82135f3d68..209a34cdd6 100644 --- a/arch/hc/include/hc12/irq.h +++ b/arch/hc/include/hc12/irq.h @@ -67,16 +67,25 @@ struct xcptcontext * Inline functions ****************************************************************************/ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Save the current interrupt enable state & disable IRQs */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { /* To be provided */ } /* Restore saved IRQ & FIQ state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { /* To be provided */ } diff --git a/arch/hc/include/hc12/types.h b/arch/hc/include/hc12/types.h index 3f2dc7c48f..bfc4993541 100644 --- a/arch/hc/include/hc12/types.h +++ b/arch/hc/include/hc12/types.h @@ -90,7 +90,7 @@ typedef unsigned long long _uint64_t; typedef signed short _intptr_t; typedef unsigned short _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave()*/ +/* This is the size of the interrupt state save returned by up_irq_save()*/ typedef unsigned int irqstate_t; diff --git a/arch/hc/include/hcs12/irq.h b/arch/hc/include/hcs12/irq.h index 4b2df8acf6..2095544eb4 100644 --- a/arch/hc/include/hcs12/irq.h +++ b/arch/hc/include/hcs12/irq.h @@ -178,6 +178,15 @@ struct xcptcontext * Inline functions ****************************************************************************/ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Enable/Disable interrupts */ #define ienable() __asm("cli"); @@ -207,14 +216,14 @@ static inline irqstate_t up_getccr(void) ( "\ttpa\n" "\tstaa %0\n" - : "=m"(ccr) : + : "=m"(ccr) : ); return ccr; } /* Save the current interrupt enable state & disable IRQs */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { irqstate_t ccr; __asm__ @@ -222,14 +231,14 @@ static inline irqstate_t irqsave(void) "\ttpa\n" "\tstaa %0\n" "\torcc #0x50\n" - : "=m"(ccr) : + : "=m"(ccr) : ); return ccr; } /* Restore saved interrupt state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { /* Should interrupts be enabled? */ @@ -244,7 +253,7 @@ static inline void irqrestore(irqstate_t flags) /* System call */ static inline void system_call3(unsigned int nbr, uintptr_t parm1, - uintptr_t parm2, uintptr_t parm3) + uintptr_t parm2, uintptr_t parm3) { /* To be provided */ /* __asm("swi") */ diff --git a/arch/hc/include/hcs12/types.h b/arch/hc/include/hcs12/types.h index fbe5d737de..87762c2040 100644 --- a/arch/hc/include/hcs12/types.h +++ b/arch/hc/include/hcs12/types.h @@ -91,7 +91,7 @@ typedef unsigned long long _uint64_t; typedef signed short _intptr_t; typedef unsigned short _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave()*/ +/* This is the size of the interrupt state save returned by up_irq_save()*/ typedef unsigned char irqstate_t; diff --git a/arch/hc/include/irq.h b/arch/hc/include/irq.h index da1f69d72f..55c8622c92 100644 --- a/arch/hc/include/irq.h +++ b/arch/hc/include/irq.h @@ -53,7 +53,7 @@ #include /* Include architecture-specific IRQ definitions (including register - * save structure and irqsave()/irqrestore() macros + * save structure and up_irq_save()/up_irq_restore() macros */ #if defined(CONFIG_ARCH_HC12) diff --git a/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c index 1ca43052c6..f80a4c3b0e 100644 --- a/arch/hc/src/common/up_exit.c +++ b/arch/hc/src/common/up_exit.c @@ -144,7 +144,7 @@ void _exit(int status) * task is started. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", this_task()); diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c index afa5165620..1790307403 100644 --- a/arch/hc/src/m9s12/m9s12_assert.c +++ b/arch/hc/src/m9s12/m9s12_assert.c @@ -295,7 +295,7 @@ static void _up_assert(int errorcode) if (current_regs || (this_task())->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (;;) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/hc/src/m9s12/m9s12_irq.c b/arch/hc/src/m9s12/m9s12_irq.c index b1c9969797..dd193d5b2d 100644 --- a/arch/hc/src/m9s12/m9s12_irq.c +++ b/arch/hc/src/m9s12/m9s12_irq.c @@ -82,6 +82,6 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(0); + up_irq_restore(0); #endif } diff --git a/arch/mips/include/irq.h b/arch/mips/include/irq.h index 58826d4bd7..3ce95be747 100644 --- a/arch/mips/include/irq.h +++ b/arch/mips/include/irq.h @@ -53,7 +53,7 @@ #include /* Include AVR architecture-specific IRQ definitions (including register - * save structure and irqsave()/irqrestore() macros + * save structure and up_irq_save()/up_irq_restore() macros */ #ifdef CONFIG_ARCH_MIPS32 diff --git a/arch/mips/include/mips32/irq.h b/arch/mips/include/mips32/irq.h index 3ca53adf1b..143387fc06 100644 --- a/arch/mips/include/mips32/irq.h +++ b/arch/mips/include/mips32/irq.h @@ -513,11 +513,17 @@ extern "C" #endif /**************************************************************************** - * Name: irqsave + * Name: up_irq_save * * Description: * Save the current interrupt state and disable interrupts. * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() is probably + * what you really want. + * * Input Parameters: * None * @@ -526,14 +532,20 @@ extern "C" * ****************************************************************************/ -irqstate_t irqsave(void); +irqstate_t up_irq_save(void); /**************************************************************************** - * Name: irqrestore + * Name: up_irq_restore * * Description: * Restore the previous interrupt state (i.e., the one previously returned - * by irqsave()) + * by up_irq_save()) + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, leave_critical_section() is probably + * what you really want. * * Input Parameters: * state - The interrupt state to be restored. @@ -543,7 +555,7 @@ irqstate_t irqsave(void); * ****************************************************************************/ -void irqrestore(irqstate_t irqtate); +void up_irq_restore(irqstate_t irqtate); #undef EXTERN #ifdef __cplusplus diff --git a/arch/mips/include/types.h b/arch/mips/include/types.h index ae39efa674..26ee3434ef 100644 --- a/arch/mips/include/types.h +++ b/arch/mips/include/types.h @@ -81,7 +81,7 @@ typedef unsigned long long _uint64_t; typedef signed int _intptr_t; typedef unsigned int _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave(). */ +/* This is the size of the interrupt state save returned by up_irq_save(). */ typedef unsigned int irqstate_t; diff --git a/arch/mips/src/common/up_exit.c b/arch/mips/src/common/up_exit.c index e3e30fa284..36a1d2b170 100644 --- a/arch/mips/src/common/up_exit.c +++ b/arch/mips/src/common/up_exit.c @@ -146,7 +146,7 @@ void _exit(int status) * task is started. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", this_task()); diff --git a/arch/mips/src/mips32/up_assert.c b/arch/mips/src/mips32/up_assert.c index d473dba94f..86f01aad73 100644 --- a/arch/mips/src/mips32/up_assert.c +++ b/arch/mips/src/mips32/up_assert.c @@ -107,7 +107,7 @@ static void _up_assert(int errorcode) if (current_regs || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (; ; ) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/mips/src/mips32/up_irq.c b/arch/mips/src/mips32/up_irq.c index e06d1f0a94..47ae02084d 100644 --- a/arch/mips/src/mips32/up_irq.c +++ b/arch/mips/src/mips32/up_irq.c @@ -48,7 +48,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: irqsave + * Name: up_irq_save * * Description: * Save the current interrupt state and disable interrupts. @@ -61,7 +61,7 @@ * ****************************************************************************/ -irqstate_t irqsave(void) +irqstate_t up_irq_save(void) { register irqstate_t status; register irqstate_t ret; @@ -75,11 +75,11 @@ irqstate_t irqsave(void) } /**************************************************************************** - * Name: irqrestore + * Name: up_irq_restore * * Description: * Restore the previous interrutp state (i.e., the one previously returned - * by irqsave()) + * by up_irq_save()) * * Input Parameters: * state - The interrupt state to be restored. @@ -89,7 +89,7 @@ irqstate_t irqsave(void) * ****************************************************************************/ -void irqrestore(irqstate_t irqstate) +void up_irq_restore(irqstate_t irqstate) { register irqstate_t status; diff --git a/arch/mips/src/mips32/up_sigdeliver.c b/arch/mips/src/mips32/up_sigdeliver.c index 23cd349208..a841a941b8 100644 --- a/arch/mips/src/mips32/up_sigdeliver.c +++ b/arch/mips/src/mips32/up_sigdeliver.c @@ -116,7 +116,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore((irqstate_t)regs[REG_STATUS]); + up_irq_restore((irqstate_t)regs[REG_STATUS]); /* Deliver the signals */ @@ -129,7 +129,7 @@ void up_sigdeliver(void) svdbg("Resuming EPC: %08x STATUS: %08x\n", regs[REG_EPC], regs[REG_STATUS]); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of diff --git a/arch/mips/src/pic32mx/pic32mx-irq.c b/arch/mips/src/pic32mx/pic32mx-irq.c index 1da0da06f7..ed066e3b80 100644 --- a/arch/mips/src/pic32mx/pic32mx-irq.c +++ b/arch/mips/src/pic32mx/pic32mx-irq.c @@ -172,11 +172,11 @@ void up_irqinitialize(void) #ifndef CONFIG_SUPPRESS_INTERRUPTS /* Then enable all interrupt levels */ - irqrestore(CP0_STATUS_IM_ALL); + up_irq_restore(CP0_STATUS_IM_ALL); #else /* Enable only software interrupts */ - irqrestore(CP0_STATUS_IM_SWINTS); + up_irq_restore(CP0_STATUS_IM_SWINTS); #endif } diff --git a/arch/mips/src/pic32mz/pic32mz-irq.c b/arch/mips/src/pic32mz/pic32mz-irq.c index e0678d2642..31d48ae8b3 100644 --- a/arch/mips/src/pic32mz/pic32mz-irq.c +++ b/arch/mips/src/pic32mz/pic32mz-irq.c @@ -253,11 +253,11 @@ void up_irqinitialize(void) #ifndef CONFIG_SUPPRESS_INTERRUPTS /* Then enable all interrupt levels */ - irqrestore(CP0_STATUS_IM_ALL); + up_irq_restore(CP0_STATUS_IM_ALL); #else /* Enable only software interrupts */ - irqrestore(CP0_STATUS_IM_SWINTS); + up_irq_restore(CP0_STATUS_IM_SWINTS); #endif } diff --git a/arch/rgmp/include/irq.h b/arch/rgmp/include/irq.h index b0411b2ab4..b4c4f37d2d 100644 --- a/arch/rgmp/include/irq.h +++ b/arch/rgmp/include/irq.h @@ -49,12 +49,15 @@ #include #include -struct xcptcontext { - struct rgmp_context ctx; - // for signal using - unsigned int save_eip; - unsigned int save_eflags; - void *sigdeliver; +struct xcptcontext +{ + struct rgmp_context ctx; + + /* For signal using */ + + unsigned int save_eip; + unsigned int save_eflags; + void *sigdeliver; }; void push_xcptcontext(struct xcptcontext *xcp); @@ -62,16 +65,25 @@ void pop_xcptcontext(struct xcptcontext *xcp); extern int nest_irq; -static inline irqstate_t irqsave(void) +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + +static inline irqstate_t up_irq_save(void) { - unsigned long flags; - local_irq_save(flags); - return flags; + unsigned long flags; + local_irq_save(flags); + return flags; } -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { - local_irq_restore(flags); + local_irq_restore(flags); } #endif /* !__ASSEMBLY__ */ diff --git a/arch/rgmp/include/types.h b/arch/rgmp/include/types.h index 90865e3e08..1f515cb70c 100644 --- a/arch/rgmp/include/types.h +++ b/arch/rgmp/include/types.h @@ -82,7 +82,7 @@ typedef unsigned int _intptr_t; typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by - * irqsave() + * up_irq_save() */ typedef unsigned int irqstate_t; diff --git a/arch/sh/include/m16c/irq.h b/arch/sh/include/m16c/irq.h index 88d4d1099c..2528e911eb 100644 --- a/arch/sh/include/m16c/irq.h +++ b/arch/sh/include/m16c/irq.h @@ -280,9 +280,18 @@ extern "C" #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Save the current interrupt enable state & disable IRQs */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { irqstate_t flags; __asm__ __volatile__ @@ -297,7 +306,7 @@ static inline irqstate_t irqsave(void) /* Restore saved IRQ & FIQ state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { __asm__ __volatile__ ( diff --git a/arch/sh/include/m16c/types.h b/arch/sh/include/m16c/types.h index 7a1a96d2b0..3211209e93 100644 --- a/arch/sh/include/m16c/types.h +++ b/arch/sh/include/m16c/types.h @@ -84,7 +84,7 @@ typedef signed int _intptr_t; typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by - * irqsave() + * up_irq_save() */ typedef _uint16_t irqstate_t; diff --git a/arch/sh/include/sh1/irq.h b/arch/sh/include/sh1/irq.h index b2d839019a..515c0c07ed 100644 --- a/arch/sh/include/sh1/irq.h +++ b/arch/sh/include/sh1/irq.h @@ -516,7 +516,7 @@ static inline void __setsr(irqstate_t sr) /* Return the current interrupt enable state & disable IRQs */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { irqstate_t flags = __getsr(); __setsr(flags | 0x000000f0); @@ -540,7 +540,7 @@ static inline void irqenable(void) /* Restore saved IRQ state */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { if ((flags & 0x000000f0) != 0x000000f0) { diff --git a/arch/sh/include/sh1/types.h b/arch/sh/include/sh1/types.h index dab1b43d1d..aeafe71c3d 100644 --- a/arch/sh/include/sh1/types.h +++ b/arch/sh/include/sh1/types.h @@ -82,7 +82,7 @@ typedef signed int _intptr_t; typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by - * irqsave() + * up_irq_save() */ typedef unsigned long irqstate_t; diff --git a/arch/sh/src/common/up_assert.c b/arch/sh/src/common/up_assert.c index 523be95688..eb3a3a4142 100644 --- a/arch/sh/src/common/up_assert.c +++ b/arch/sh/src/common/up_assert.c @@ -95,7 +95,7 @@ static void _up_assert(int errorcode) if (current_regs || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (;;) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/sh/src/common/up_exit.c b/arch/sh/src/common/up_exit.c index 4f7e4ab049..84845556e9 100644 --- a/arch/sh/src/common/up_exit.c +++ b/arch/sh/src/common/up_exit.c @@ -145,7 +145,7 @@ void _exit(int status) * task is started. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", this_task()); diff --git a/arch/sh/src/m16c/m16c_irq.c b/arch/sh/src/m16c/m16c_irq.c index 04b971200f..e07090ed4d 100644 --- a/arch/sh/src/m16c/m16c_irq.c +++ b/arch/sh/src/m16c/m16c_irq.c @@ -81,7 +81,7 @@ void up_irqinitialize(void) * * This function implements disabling of the device specified by 'irq' * at the interrupt controller level if supported by the architecture - * (irqsave() supports the global level, the device level is hardware + * (up_irq_save() supports the global level, the device level is hardware * specific). * ****************************************************************************/ @@ -98,7 +98,7 @@ void up_disable_irq(int irq) * Description: * This function implements enabling of the device specified by 'irq' * at the interrupt controller level if supported by the architecture - * (irqsave() supports the global level, the device level is hardware + * (up_irq_save() supports the global level, the device level is hardware * specific). * ****************************************************************************/ diff --git a/arch/sh/src/m16c/m16c_sigdeliver.c b/arch/sh/src/m16c/m16c_sigdeliver.c index c4b35d5ec6..3b595ed7ef 100644 --- a/arch/sh/src/m16c/m16c_sigdeliver.c +++ b/arch/sh/src/m16c/m16c_sigdeliver.c @@ -117,7 +117,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state. */ - irqrestore(rtcb->xcp.saved_flg); + up_irq_restore(rtcb->xcp.saved_flg); /* Deliver the signals */ @@ -129,7 +129,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of diff --git a/arch/sh/src/sh1/sh1_sigdeliver.c b/arch/sh/src/sh1/sh1_sigdeliver.c index b41b1b4cbb..eead3c06f2 100644 --- a/arch/sh/src/sh1/sh1_sigdeliver.c +++ b/arch/sh/src/sh1/sh1_sigdeliver.c @@ -116,7 +116,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state. */ - irqrestore(regs[REG_SR] & 0x000000f0); + up_irq_restore(regs[REG_SR] & 0x000000f0); /* Deliver the signals */ @@ -128,7 +128,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/sim/include/irq.h b/arch/sim/include/irq.h index 47bcb37826..9a9781dda4 100644 --- a/arch/sim/include/irq.h +++ b/arch/sim/include/irq.h @@ -91,12 +91,22 @@ struct xcptcontext ****************************************************************************/ #ifndef __ASSEMBLY__ -static inline irqstate_t irqsave(void) + +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + +static inline irqstate_t up_irq_save(void) { return 0; } -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { } #endif diff --git a/arch/sim/include/types.h b/arch/sim/include/types.h index 24bae96b3f..83669eac3e 100644 --- a/arch/sim/include/types.h +++ b/arch/sim/include/types.h @@ -90,7 +90,7 @@ typedef unsigned int _uintptr_t; #endif /* This is the size of the interrupt state save returned by - * irqsave() + * up_irq_save() */ typedef unsigned int irqstate_t; diff --git a/arch/x86/include/i486/irq.h b/arch/x86/include/i486/irq.h index 493cf206f9..1918fe60e8 100644 --- a/arch/x86/include/i486/irq.h +++ b/arch/x86/include/i486/irq.h @@ -193,6 +193,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + /* Get the current FLAGS register contents */ static inline irqstate_t irqflags() @@ -239,7 +248,7 @@ static inline void irqenable(void) /* Disable interrupts, but return previous interrupt state */ -static inline irqstate_t irqsave(void) +static inline irqstate_t up_irq_save(void) { irqstate_t flags = irqflags(); irqdisable(); @@ -248,7 +257,7 @@ static inline irqstate_t irqsave(void) /* Conditionally disable interrupts */ -static inline void irqrestore(irqstate_t flags) +static inline void up_irq_restore(irqstate_t flags) { if (irqenabled(flags)) { diff --git a/arch/x86/include/i486/types.h b/arch/x86/include/i486/types.h index 1fde978be6..5e1f2ced31 100644 --- a/arch/x86/include/i486/types.h +++ b/arch/x86/include/i486/types.h @@ -83,7 +83,7 @@ typedef signed int _intptr_t; typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by - * irqsave() + * up_irq_save() */ typedef unsigned int irqstate_t; diff --git a/arch/x86/include/irq.h b/arch/x86/include/irq.h index 4c46b5f6e3..7d80f8a333 100644 --- a/arch/x86/include/irq.h +++ b/arch/x86/include/irq.h @@ -53,7 +53,7 @@ #include /* Include architecture-specific IRQ definitions (including register save - * structure and irqsave()/irqrestore() macros). + * structure and up_irq_save()/up_irq_restore() macros). */ #ifdef CONFIG_ARCH_I486 diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c index 83026e4f07..669a7087d3 100644 --- a/arch/x86/src/common/up_assert.c +++ b/arch/x86/src/common/up_assert.c @@ -253,7 +253,7 @@ static void _up_assert(int errorcode) if (current_regs || (this_task())->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (;;) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c index cac16ba84f..12779df024 100644 --- a/arch/x86/src/common/up_exit.c +++ b/arch/x86/src/common/up_exit.c @@ -144,7 +144,7 @@ void _exit(int status) * task is started. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", this_task()); diff --git a/arch/x86/src/i486/up_irq.c b/arch/x86/src/i486/up_irq.c index d144b2b9e5..430876606e 100644 --- a/arch/x86/src/i486/up_irq.c +++ b/arch/x86/src/i486/up_irq.c @@ -272,7 +272,7 @@ void up_irqinitialize(void) /* And finally, enable interrupts */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(X86_FLAGS_IF); + up_irq_restore(X86_FLAGS_IF); #endif } diff --git a/arch/x86/src/i486/up_sigdeliver.c b/arch/x86/src/i486/up_sigdeliver.c index b909c2e452..e807c3d616 100644 --- a/arch/x86/src/i486/up_sigdeliver.c +++ b/arch/x86/src/i486/up_sigdeliver.c @@ -115,7 +115,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state */ - irqrestore(regs[REG_EFLAGS]); + up_irq_restore(regs[REG_EFLAGS]); /* Deliver the signals */ @@ -127,7 +127,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z16/include/types.h b/arch/z16/include/types.h index 2f77289c5c..cafeeb4c28 100644 --- a/arch/z16/include/types.h +++ b/arch/z16/include/types.h @@ -78,7 +78,7 @@ typedef signed int _intptr_t; typedef unsigned int _uintptr_t; /* This is the size of the interrupt state save returned by - * irqsave() + * up_irq_save() */ typedef unsigned short irqstate_t; diff --git a/arch/z16/include/z16f/irq.h b/arch/z16/include/z16f/irq.h index 5dfd08470c..8dac657a63 100644 --- a/arch/z16/include/z16f/irq.h +++ b/arch/z16/include/z16f/irq.h @@ -196,13 +196,19 @@ struct xcptcontext /* The ZDS-II provides built-in operations to test & disable and to restore * the interrupt state. * - * irqstate_t irqsave(void); - * void irqrestore(irqstate_t flags); + * irqstate_t up_irq_save(void); + * void up_irq_restore(irqstate_t flags); + * + * NOTE: These functions should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. */ #ifdef __ZILOG__ -# define irqsave() TDI() -# define irqrestore(f) RI(f) +# define up_irq_save() TDI() +# define up_irq_restore(f) RI(f) #endif /**************************************************************************** @@ -235,8 +241,8 @@ intrinsic void SET_VECTOR(int,void (* func) (void)); intrinsic unsigned short TDI(void); #ifndef __ZILOG__ -irqstate_t irqsave(void); -void irqrestore(irqstate_t flags); +irqstate_t up_irq_save(void); +void up_irq_restore(irqstate_t flags); #endif #undef EXTERN diff --git a/arch/z16/src/common/up_assert.c b/arch/z16/src/common/up_assert.c index 4ad4d77fdd..fbd73d2579 100644 --- a/arch/z16/src/common/up_assert.c +++ b/arch/z16/src/common/up_assert.c @@ -90,7 +90,7 @@ static void _up_assert(int errorcode) /* noreturn_function */ if (up_interrupt_context() || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (;;) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/z16/src/common/up_exit.c b/arch/z16/src/common/up_exit.c index 3d7313dbf6..7c238b2499 100644 --- a/arch/z16/src/common/up_exit.c +++ b/arch/z16/src/common/up_exit.c @@ -137,7 +137,7 @@ void _exit(int status) * the new task is resumed below. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", tcb); diff --git a/arch/z16/src/common/up_sigdeliver.c b/arch/z16/src/common/up_sigdeliver.c index df00c1c1b4..9861f0096e 100644 --- a/arch/z16/src/common/up_sigdeliver.c +++ b/arch/z16/src/common/up_sigdeliver.c @@ -120,7 +120,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z80/include/ez80/irq.h b/arch/z80/include/ez80/irq.h index c7ca8ba704..33b00783ef 100644 --- a/arch/z80/include/ez80/irq.h +++ b/arch/z80/include/ez80/irq.h @@ -250,8 +250,17 @@ extern "C" #define EXTERN extern #endif -irqstate_t irqsave(void); -void irqrestore(irqstate_t flags); +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + +irqstate_t up_irq_save(void); +void up_irq_restore(irqstate_t flags); #undef EXTERN #ifdef __cplusplus diff --git a/arch/z80/include/ez80/types.h b/arch/z80/include/ez80/types.h index 56a9c8b825..1f0d46957d 100644 --- a/arch/z80/include/ez80/types.h +++ b/arch/z80/include/ez80/types.h @@ -100,7 +100,7 @@ typedef signed int _intptr_t; typedef unsigned int _uintptr_t; #endif -/* This is the size of the interrupt state save returned by irqsave(). +/* This is the size of the interrupt state save returned by up_irq_save(). * It holds the AF regiser pair + a zero pad byte */ diff --git a/arch/z80/include/z180/irq.h b/arch/z80/include/z180/irq.h index bfd3639377..ec2dbb7b57 100644 --- a/arch/z80/include/z180/irq.h +++ b/arch/z80/include/z180/irq.h @@ -223,8 +223,17 @@ extern "C" #define EXTERN extern #endif -irqstate_t irqsave(void) __naked; -void irqrestore(irqstate_t flags) __naked; +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + +irqstate_t up_irq_save(void) __naked; +void up_irq_restore(irqstate_t flags) __naked; #undef EXTERN #ifdef __cplusplus diff --git a/arch/z80/include/z180/types.h b/arch/z80/include/z180/types.h index 3c4f593b2a..39498a9002 100644 --- a/arch/z80/include/z180/types.h +++ b/arch/z80/include/z180/types.h @@ -86,7 +86,7 @@ typedef unsigned long _uint32_t; typedef signed int _intptr_t; typedef unsigned int _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave() */ +/* This is the size of the interrupt state save returned by up_irq_save() */ typedef _uint16_t irqstate_t; diff --git a/arch/z80/include/z8/irq.h b/arch/z80/include/z8/irq.h index 7bc706d8d5..7088234f6b 100644 --- a/arch/z80/include/z8/irq.h +++ b/arch/z80/include/z8/irq.h @@ -356,8 +356,17 @@ extern "C" #define EXTERN extern #endif -irqstate_t irqsave(void); -void irqrestore(irqstate_t flags); +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + +irqstate_t up_irq_save(void); +void up_irq_restore(irqstate_t flags); #undef EXTERN #ifdef __cplusplus diff --git a/arch/z80/include/z8/types.h b/arch/z80/include/z8/types.h index 7e0577b31c..4c66f56871 100644 --- a/arch/z80/include/z8/types.h +++ b/arch/z80/include/z8/types.h @@ -93,7 +93,7 @@ typedef unsigned long _uint32_t; typedef signed int _intptr_t; typedef unsigned int _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave() */ +/* This is the size of the interrupt state save returned by up_irq_save() */ typedef _uint8_t irqstate_t; diff --git a/arch/z80/include/z80/irq.h b/arch/z80/include/z80/irq.h index 10fd0be62e..020c777a1c 100644 --- a/arch/z80/include/z80/irq.h +++ b/arch/z80/include/z80/irq.h @@ -113,8 +113,8 @@ struct xcptcontext /* The following retains that state during signal execution */ - uint16_t saved_pc; /* Saved return address */ - uint16_t saved_i; /* Saved interrupt state */ + uint16_t saved_pc; /* Saved return address */ + uint16_t saved_i; /* Saved interrupt state */ #endif }; #endif @@ -140,8 +140,17 @@ extern "C" #define EXTERN extern #endif -irqstate_t irqsave(void) __naked; -void irqrestore(irqstate_t flags) __naked; +/* Name: up_irq_save, up_irq_restore, and friends. + * + * NOTE: This function should never be called from application code and, + * as a general rule unless you really know what you are doing, this + * function should not be called directly from operation system code either: + * Typically, the wrapper functions, enter_critical_section() and + * leave_critical section(), are probably what you really want. + */ + +irqstate_t up_irq_save(void) __naked; +void up_irq_restore(irqstate_t flags) __naked; #undef EXTERN #ifdef __cplusplus diff --git a/arch/z80/include/z80/types.h b/arch/z80/include/z80/types.h index d11868e033..4d6d8ed5b1 100644 --- a/arch/z80/include/z80/types.h +++ b/arch/z80/include/z80/types.h @@ -86,7 +86,7 @@ typedef unsigned long _uint32_t; typedef signed int _intptr_t; typedef unsigned int _uintptr_t; -/* This is the size of the interrupt state save returned by irqsave() */ +/* This is the size of the interrupt state save returned by up_irq_save() */ typedef _uint16_t irqstate_t; diff --git a/arch/z80/src/common/up_assert.c b/arch/z80/src/common/up_assert.c index ee290781e0..78e114d35d 100644 --- a/arch/z80/src/common/up_assert.c +++ b/arch/z80/src/common/up_assert.c @@ -93,7 +93,7 @@ static void _up_assert(int errorcode) /* noreturn_function */ if (up_interrupt_context() || this_task()->pid == 0) { - (void)irqsave(); + (void)up_irq_save(); for (;;) { #ifdef CONFIG_ARCH_LEDS diff --git a/arch/z80/src/common/up_exit.c b/arch/z80/src/common/up_exit.c index 3488fdbdc8..82f647c18c 100644 --- a/arch/z80/src/common/up_exit.c +++ b/arch/z80/src/common/up_exit.c @@ -147,7 +147,7 @@ void _exit(int status) * the new task is resumed below. */ - (void)irqsave(); + (void)up_irq_save(); slldbg("TCB=%p exiting\n", tcb); diff --git a/arch/z80/src/ez80/Make.defs b/arch/z80/src/ez80/Make.defs index 5b4defd8e7..7e79e19d65 100644 --- a/arch/z80/src/ez80/Make.defs +++ b/arch/z80/src/ez80/Make.defs @@ -44,7 +44,7 @@ CMN_CSRCS += up_reprioritizertr.c up_idle.c up_assert.c up_doirq.c CMN_CSRCS += up_mdelay.c up_stackframe.c up_udelay.c up_usestack.c CMN_CSRCS += up_puts.c -CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_irqsave.asm +CHIP_ASRCS = ez80_startup.asm ez80_io.asm ez80_up_irq_save.asm CHIP_ASRCS += ez80_saveusercontext.asm ez80_restorecontext.asm ifeq ($(CONFIG_ARCH_CHIP_EZ80F91),y) CHIP_ASRCS += ez80f91_init.asm diff --git a/arch/z80/src/ez80/ez80_irq.c b/arch/z80/src/ez80/ez80_irq.c index 774fe02e02..c2e46346ae 100644 --- a/arch/z80/src/ez80/ez80_irq.c +++ b/arch/z80/src/ez80/ez80_irq.c @@ -85,7 +85,7 @@ void up_irqinitialize(void) * * This function implements disabling of the device specified by 'irq' * at the interrupt controller level if supported by the architecture - * (irqsave() supports the global level, the device level is hardware + * (up_irq_save() supports the global level, the device level is hardware * specific). * ****************************************************************************/ @@ -101,7 +101,7 @@ void up_disable_irq(int irq) * Description: * This function implements enabling of the device specified by 'irq' * at the interrupt controller level if supported by the architecture - * (irqsave() supports the global level, the device level is hardware + * (up_irq_save() supports the global level, the device level is hardware * specific). * ****************************************************************************/ diff --git a/arch/z80/src/ez80/ez80_irqsave.asm b/arch/z80/src/ez80/ez80_irqsave.asm index 0efae6a478..de3ad4a6e2 100644 --- a/arch/z80/src/ez80/ez80_irqsave.asm +++ b/arch/z80/src/ez80/ez80_irqsave.asm @@ -1,5 +1,5 @@ ;************************************************************************** -; arch/z80/src/ez80/ez80_irqsave.asm +; arch/z80/src/ez80/ez80_up_irq_save.asm ; ; Copyright (C) 2008 Gregory Nutt. All rights reserved. ; Author: Gregory Nutt @@ -41,8 +41,8 @@ ; Global Symbols Expported ;************************************************************************** - xdef _irqsave - xdef _irqrestore + xdef _up_irq_save + xdef _up_irq_restore ;************************************************************************** ; Code @@ -52,14 +52,14 @@ .assume ADL=1 ;************************************************************************** -;* Name: irqstate_t irqsave(void) +;* Name: irqstate_t up_irq_save(void) ;* ;* Description: ;* Disable all interrupts; return previous interrupt state ;* ;************************************************************************** -_irqsave: +_up_irq_save: ld a, i ; AF = interrupt state di ; Interrupts are disabled (does not affect F) push af ; Transfer to HL via the stack @@ -67,14 +67,14 @@ _irqsave: ret ; And return ;************************************************************************** -;* Name: void irqrestore(irqstate_t flags) +;* Name: void up_irq_restore(irqstate_t flags) ;* ;* Description: ;* Restore previous interrupt state ;* ;************************************************************************** -_irqrestore: +_up_irq_restore: di ; Assume disabled pop hl ; HL = return address pop af ; AF Parity bit holds interrupt state diff --git a/arch/z80/src/ez80/ez80_sigdeliver.c b/arch/z80/src/ez80/ez80_sigdeliver.c index cbd1ad223d..657961ce59 100644 --- a/arch/z80/src/ez80/ez80_sigdeliver.c +++ b/arch/z80/src/ez80/ez80_sigdeliver.c @@ -116,7 +116,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state. */ - irqrestore(regs[XCPT_I]); + up_irq_restore(regs[XCPT_I]); /* Deliver the signals */ @@ -128,7 +128,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of diff --git a/arch/z80/src/z180/z180_irq.c b/arch/z80/src/z180/z180_irq.c index c9cadb3420..f90e9a9678 100644 --- a/arch/z80/src/z180/z180_irq.c +++ b/arch/z80/src/z180/z180_irq.c @@ -99,14 +99,14 @@ static void z180_seti(uint8_t value) __naked ****************************************************************************/ /**************************************************************************** - * Name: irqsave + * Name: up_irq_save * * Description: * Disable all interrupts; return previous interrupt state * ****************************************************************************/ -irqstate_t irqsave(void) __naked +irqstate_t up_irq_save(void) __naked { __asm ld a, i ; AF Parity bit holds interrupt state @@ -118,14 +118,14 @@ irqstate_t irqsave(void) __naked } /**************************************************************************** - * Name: irqrestore + * Name: up_irq_restore * * Description: * Restore previous interrupt state * ****************************************************************************/ -void irqrestore(irqstate_t flags) __naked +void up_irq_restore(irqstate_t flags) __naked { __asm di ; Assume disabled @@ -170,6 +170,6 @@ void up_irqinitialize(void) /* And finally, enable interrupts (including the timer) */ #ifndef CONFIG_SUPPRESS_INTERRUPTS - irqrestore(Z180_C_FLAG); + up_irq_restore(Z180_C_FLAG); #endif } diff --git a/arch/z80/src/z180/z180_sigdeliver.c b/arch/z80/src/z180/z180_sigdeliver.c index 076435270d..e058d5a116 100644 --- a/arch/z80/src/z180/z180_sigdeliver.c +++ b/arch/z80/src/z180/z180_sigdeliver.c @@ -115,7 +115,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state. */ - irqrestore(regs[XCPT_I]); + up_irq_restore(regs[XCPT_I]); /* Deliver the signals */ @@ -127,7 +127,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z80/src/z8/z8_irq.c b/arch/z80/src/z8/z8_irq.c index 0fb80f7e34..17c6881baf 100644 --- a/arch/z80/src/z8/z8_irq.c +++ b/arch/z80/src/z8/z8_irq.c @@ -83,14 +83,14 @@ void up_irqinitialize(void) } /**************************************************************************** - * Name: irqsave + * Name: up_irq_save * * Description: * Disable all interrupts; return previous interrupt state * ****************************************************************************/ -irqstate_t irqsave(void) +irqstate_t up_irq_save(void) { /* Bit 7 (IRQE) of the IRQCTL register determines if interrupts were * enabled when this function was called. @@ -108,17 +108,17 @@ irqstate_t irqsave(void) } /**************************************************************************** - * Name: irqrestore + * Name: up_irq_restore * * Description: * Restore previous interrupt state * ****************************************************************************/ -void irqrestore(irqstate_t flags) +void up_irq_restore(irqstate_t flags) { /* Bit 7 (IRQE) of the IRQCTL register determines if interrupts were - * enabled when irqsave() was called. + * enabled when up_irq_save() was called. */ if ((flags & 0x80) != 0) diff --git a/arch/z80/src/z8/z8_sigdeliver.c b/arch/z80/src/z8/z8_sigdeliver.c index 5101da2692..1cbb7e2159 100644 --- a/arch/z80/src/z8/z8_sigdeliver.c +++ b/arch/z80/src/z8/z8_sigdeliver.c @@ -130,7 +130,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state. */ - irqrestore(regs[XCPT_IRQCTL]); + up_irq_restore(regs[XCPT_IRQCTL]); /* Deliver the signals */ @@ -142,7 +142,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */ diff --git a/arch/z80/src/z80/z80_irq.c b/arch/z80/src/z80/z80_irq.c index 4af2752ca9..c1108f5bad 100644 --- a/arch/z80/src/z80/z80_irq.c +++ b/arch/z80/src/z80/z80_irq.c @@ -59,14 +59,14 @@ volatile chipreg_t *current_regs; ****************************************************************************/ /**************************************************************************** - * Name: irqsave + * Name: up_irq_save * * Description: * Disable all interrupts; return previous interrupt state * ****************************************************************************/ -irqstate_t irqsave(void) __naked +irqstate_t up_irq_save(void) __naked { __asm ld a, i ; AF Parity bit holds interrupt state @@ -78,14 +78,14 @@ irqstate_t irqsave(void) __naked } /**************************************************************************** - * Name: irqrestore + * Name: up_irq_restore * * Description: * Restore previous interrupt state * ****************************************************************************/ -void irqrestore(irqstate_t flags) __naked +void up_irq_restore(irqstate_t flags) __naked { __asm di ; Assume disabled diff --git a/arch/z80/src/z80/z80_sigdeliver.c b/arch/z80/src/z80/z80_sigdeliver.c index 3de591ce4c..b56d1afd32 100644 --- a/arch/z80/src/z80/z80_sigdeliver.c +++ b/arch/z80/src/z80/z80_sigdeliver.c @@ -115,7 +115,7 @@ void up_sigdeliver(void) /* Then restore the task interrupt state. */ - irqrestore(regs[XCPT_I]); + up_irq_restore(regs[XCPT_I]); /* Deliver the signals */ @@ -127,7 +127,7 @@ void up_sigdeliver(void) */ sdbg("Resuming\n"); - (void)irqsave(); + (void)up_irq_save(); rtcb->pterrno = saved_errno; /* Then restore the correct state for this thread of execution. */