X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=aversive%2Firq_lock.h;fp=aversive%2Firq_lock.h;h=0000000000000000000000000000000000000000;hb=57895b3bb2fe0582c589685b7df34f3968b346ec;hp=055c2479125b457ffdff147616356ed45a96c0d7;hpb=9a9b64112aee5ab26398b46cb13b7e49c292a355;p=protos%2Fxbee-avr.git diff --git a/aversive/irq_lock.h b/aversive/irq_lock.h deleted file mode 100644 index 055c247..0000000 --- a/aversive/irq_lock.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright Droids Corporation, Microb Technology, Eirbot (2005) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Revision : $Id: irq_lock.h,v 1.1.2.1 2007-05-23 17:18:09 zer0 Exp $ - * - */ - -/** \file modules/base/utils/irq_lock_macros.h - * \brief Interface of the utils module - * - * here are defined the three macros : - * - * IRQ_LOCK(flags); this saves interrupt state - * IRQ_UNLOCK(flags); this restores interrupt state - * - * code example follows: - * - * uint8_t flags; - * IRQ_LOCK(flags); - * // code to be protected against interrupts ... - * IRQ_UNLOCK(flags); // needs to be associated with an unlock - * - */ - - -#ifndef _AVERSIVE_IRQ_LOCK_H_ -#define _AVERSIVE_IRQ_LOCK_H_ - -#ifdef HOST_VERSION - -#ifdef CONFIG_MODULE_HOSTSIM -#include - -/* we must use 'flags' to avoid a warning */ -#define IRQ_UNLOCK(flags) do { flags=0; /* hostsim_lock(); */ } while(0) -#define IRQ_LOCK(flags) do { flags=0; /* hostsim_unlock(); */ } while(0) -#define GLOBAL_IRQ_ARE_MASKED() hostsim_islocked() -#else -#define IRQ_UNLOCK(flags) do { flags=0; } while(0) -#define IRQ_LOCK(flags) do { flags=0; } while(0) -#define GLOBAL_IRQ_ARE_MASKED() (0) -#endif /* CONFIG_MODULE_HOSTSIM */ - -#else - -#define GLOBAL_IRQ_ARE_MASKED() (!(bit_is_set(SREG,7))) - -#define IRQ_LOCK(flags) do { \ - flags = SREG; \ - cli(); \ - } while(0) - -#define IRQ_UNLOCK(flags) do { \ - SREG = flags; \ - } while ( 0 ) - -#endif /* ! HOST_VERSION */ - -#endif /* _AVERSIVE_IRQ_LOCK_H_ */