]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
a pile of @safe() annotations; should not affect anyone
authorregehr <regehr>
Thu, 26 Jun 2008 04:39:00 +0000 (04:39 +0000)
committerregehr <regehr>
Thu, 26 Jun 2008 04:39:00 +0000 (04:39 +0000)
31 files changed:
tos/chips/atm128/adc/AdcP.nc
tos/chips/atm128/adc/Atm128AdcP.nc
tos/chips/atm128/adc/HplAtm128AdcP.nc
tos/chips/atm128/atm128hardware.h
tos/chips/atm128/crc.h
tos/chips/atm128/pins/Atm128GpioInterruptC.nc
tos/chips/atm128/pins/HplAtm128InterruptSigP.nc
tos/chips/atm128/spi/HplAtm128SpiP.nc
tos/chips/atm128/timer/Atm128AlarmC.nc
tos/chips/atm128/timer/Atm128CounterC.nc
tos/chips/atm128/timer/Atm128GpioCaptureC.nc
tos/chips/atm128/timer/Atm128TimerInitC.nc
tos/chips/cc1000/CC1000ControlP.nc
tos/chips/cc1000/CC1000RssiP.nc
tos/chips/cc1000/CC1000SquelchP.nc
tos/chips/msp430/msp430hardware.h
tos/chips/msp430/pins/Msp430InterruptC.nc
tos/chips/msp430/usart/Msp430UsartShareP.nc
tos/lib/power/AsyncPowerManagerP.nc
tos/platforms/mica/BusyWaitMicroC.nc
tos/platforms/mica2/MotePlatformP.nc
tos/platforms/mica2/chips/cc1000/HplCC1000P.nc
tos/platforms/mica2/chips/cc1000/HplCC1000SpiP.nc
tos/platforms/micaz/chips/cc2420/HplCC2420InterruptsP.nc
tos/platforms/micaz/chips/cc2420/HplCC2420SpiP.nc
tos/platforms/telosb/hardware.h
tos/system/ArbitratedReadC.nc
tos/system/NoInitC.nc
tos/system/RoundRobinResourceQueueC.nc
tos/system/SimpleArbiterP.nc
tos/types/TinyError.h

index fa918c7f1a93079986c63d1e05046948df6f164b..6b742dd55f8ea4589f8545a3e3936c32048bafbf 100644 (file)
@@ -43,7 +43,7 @@
  */
 #include "Timer.h"
 
-module AdcP {
+module AdcP @safe() {
   provides {
     interface Read<uint16_t>[uint8_t client];
     interface ReadNow<uint16_t>[uint8_t client];
index 06cc5261a550027b254d80e5e70338b853a77d46..1b7dd65178c0298b7d4bd868975425fc006c2756 100644 (file)
@@ -59,7 +59,7 @@
  * @author Hu Siquan <husq@xbow.com>
  */
 
-module Atm128AdcP 
+module Atm128AdcP @safe()
 {
   provides {
     interface Init;
index c95910e2c7712f131b50bcc698af078931a29e3a..28ab5cd440a5f7900ad756dad4579bcf301af1be 100644 (file)
@@ -31,7 +31,7 @@
  * @author David Gay
  */
 
-module HplAtm128AdcP {
+module HplAtm128AdcP @safe() {
   provides interface HplAtm128Adc;
   uses interface McuPowerState;
 }
index 9cc0e93797df5dc1c5a93ce1e586073ef7b39205..89f312f8481559f06dafa048651b068c57a8c259 100644 (file)
 #define READ_FLAG(port, flag) ((port) & (flag))
 
 /* Enables interrupts. */
-inline void __nesc_enable_interrupt() {
+inline void __nesc_enable_interrupt() @safe() {
     sei();
 }
 /* Disables all interrupts. */
-inline void __nesc_disable_interrupt() {
+inline void __nesc_disable_interrupt() @safe() {
     cli();
 }
 
@@ -100,7 +100,7 @@ void __nesc_atomic_end(__nesc_atomic_t original_SREG);
 
 /* Saves current interrupt mask state and disables interrupts. */
 inline __nesc_atomic_t 
-__nesc_atomic_start(void) @spontaneous()
+__nesc_atomic_start(void) @spontaneous() @safe()
 {
     __nesc_atomic_t result = SREG;
     __nesc_disable_interrupt();
@@ -110,7 +110,7 @@ __nesc_atomic_start(void) @spontaneous()
 
 /* Restores interrupt mask to original state. */
 inline void 
-__nesc_atomic_end(__nesc_atomic_t original_SREG) @spontaneous()
+__nesc_atomic_end(__nesc_atomic_t original_SREG) @spontaneous() @safe()
 {
   asm volatile("" : : : "memory"); /* ensure atomic section effect visibility */
   SREG = original_SREG;
@@ -131,7 +131,7 @@ enum {
 };
 
 /* Combine function.  */
-mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) {
+mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) @safe() {
   return (m1 < m2)? m1: m2;
 }
 
index 13740d881dd635a7be7198fab5fd19c196a3788d..c552f7731c16238f42e0db6324c7b4c0d6945f3f 100644 (file)
@@ -78,7 +78,7 @@ uint16_t crcTable[256] PROGMEM = {
  * @param b Byte to "add" to the CRC
  * @return New CRC value
  */
-uint16_t crcByte(uint16_t oldCrc, uint8_t byte) __attribute__((noinline))
+uint16_t crcByte(uint16_t oldCrc, uint8_t byte) __attribute__((noinline)) @safe()
 {
 #if 1
   uint16_t *table = crcTable;
index cd168e6de61a1db7b811320d36554c1ad9fa6777..901d70faaa8b90f1efa46a789415e98d760fbbc1 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * @author Phil Levis
  */
-generic module Atm128GpioInterruptC() {
+generic module Atm128GpioInterruptC() @safe() {
 
   provides interface GpioInterrupt as Interrupt;
   uses interface HplAtm128Interrupt as Atm128Interrupt;
index b424cb6b0748457e9ee4ba1a87402f2e385586b2..0e7125babf621d316ae43427efb39c07a387c3ae 100644 (file)
@@ -29,7 +29,7 @@
  *
  * @author Martin Turon <mturon@xbow.com>
  */
-module HplAtm128InterruptSigP
+module HplAtm128InterruptSigP @safe()
 {
   provides interface HplAtm128InterruptSig as IntSig0;
   provides interface HplAtm128InterruptSig as IntSig1;
index 17c003f7bbe58c1788bb60c754cfed212e903eb2..674a88c3436fa37c5c2765741cd86ced242e6722 100644 (file)
@@ -53,7 +53,7 @@
 
 #include "Atm128Spi.h"
 
-module HplAtm128SpiP {
+module HplAtm128SpiP @safe() {
   provides interface Atm128Spi as SPI;
   provides interface AsyncStdControl;
   
index b16f784482e43ebcd665d2361efd441310850ea4..567e6fd7dab8762a6e065101ac5c2608d8010a40 100644 (file)
@@ -41,7 +41,7 @@
 
 generic module Atm128AlarmC(typedef frequency_tag, 
                            typedef timer_size @integer(),
-                           int mindt)
+                           int mindt) @safe()
 {
   provides interface Alarm<frequency_tag, timer_size> as Alarm @atmostonce();
 
index b34fd8a90701d033cfd0cd555db3b9fc4d1fc5e5..c40bd65ba7a5a912008c50df2e1fee6b0965f1c2 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 generic module Atm128CounterC(typedef frequency_tag,
-                             typedef timer_size @integer())
+                             typedef timer_size @integer()) @safe()
 {
   provides interface Counter<frequency_tag,timer_size> as Counter;
   uses interface HplAtm128Timer<timer_size> as Timer;
index a6c3757206b3794cea1f1ae63250b9d42383e73b..a74dc56b143d81b91d2487ad8834e745250de17b 100644 (file)
@@ -30,7 +30,7 @@
  *
  * @author Martin Turon, Crossbow <mturon@xbow.com>
  */
-generic module Atm128GpioCaptureC() {
+generic module Atm128GpioCaptureC() @safe() {
 
   provides interface GpioCapture as Capture;
   uses interface HplAtm128Capture<uint16_t> as Atm128Capture;
index dd309340b33f89ff63d5668b98c5f67fc0877dab..9b4a86b2f6f158812050982e0865811d2ef2e239 100644 (file)
@@ -32,7 +32,7 @@
  * @author David Gay <david.e.gay@intel.com>
  */
 
-generic module Atm128TimerInitC(typedef timer_size @integer(), uint8_t prescaler)
+generic module Atm128TimerInitC(typedef timer_size @integer(), uint8_t prescaler) @safe()
 {
   provides interface Init @atleastonce();
   uses interface HplAtm128Timer<timer_size> as Timer;
index 81c0f3c76bd52424a62a1c9071006ce4b5e432fd..682c7b1ed1c68e363f425e2c793a943a465083fb 100644 (file)
@@ -38,7 +38,7 @@
  * @author Jaein Jeong
  * @author David Gay
  */
-module CC1000ControlP {
+module CC1000ControlP @safe() {
   provides {
     interface CC1000Control;
   }
index ee6ccd087df5b5a183fd9e96881d58cd5c6078bd..bdb2def138c743c282ac5e2211b8cdb7373e154d 100644 (file)
@@ -41,7 +41,7 @@
  *   the stack.
  */
 
-module CC1000RssiP
+module CC1000RssiP @safe()
 {
   provides {
     interface ReadNow<uint16_t> as Rssi[uint8_t reason];
index 5a31cde3b1a7fdffd73cf7cf062ffe7c740c436c..321d30e4e8f7e211c18cf305d33e340ed52fe9d9 100644 (file)
@@ -37,7 +37,7 @@
  * @author David Gay
  */
   
-module CC1000SquelchP
+module CC1000SquelchP @safe()
 {
   provides {
     interface Init;
index c7a96d0495d5fe4e599964f05c84dfe8b5080556..e0d9cbac33096f04a3e01bf87254d6791db5e223 100644 (file)
@@ -77,7 +77,7 @@ MSP430REG_NORACE3(TYPE_##name,name,name##_)
 // creating potentially broken object code.  Union casts are the appropriate work
 // around.  Unfortunately, they require a function definiton.
 #define DEFINE_UNION_CAST(func_name,to_type,from_type) \
-to_type func_name(from_type x) { union {from_type f; to_type t;} c = {f:x}; return c.t; }
+to_type func_name(from_type x) @safe() { union {from_type f; to_type t;} c = {f:x}; return c.t; }
 
 // redefine ugly defines from msp-gcc
 #ifndef DONT_REDEFINE_SR_FLAGS
@@ -178,20 +178,20 @@ MSP430REG_NORACE2(I2CDCTLnr,I2CDCTL);
 // be detectde by nesc.
 
 #define TOSH_ASSIGN_PIN_HEX(name, port, hex) \
-void TOSH_SET_##name##_PIN() { MSP430REG_NORACE2(r,P##port##OUT); r |= hex; } \
-void TOSH_CLR_##name##_PIN() { MSP430REG_NORACE2(r,P##port##OUT); r &= ~hex; } \
-void TOSH_TOGGLE_##name##_PIN() { MSP430REG_NORACE2(r,P##port##OUT); r ^= hex; } \
-uint8_t TOSH_READ_##name##_PIN() { MSP430REG_NORACE2(r,P##port##IN); return (r & hex); } \
-void TOSH_MAKE_##name##_OUTPUT() { MSP430REG_NORACE2(r,P##port##DIR); r |= hex; } \
-void TOSH_MAKE_##name##_INPUT() { MSP430REG_NORACE2(r,P##port##DIR); r &= ~hex; } \
-void TOSH_SEL_##name##_MODFUNC() { MSP430REG_NORACE2(r,P##port##SEL); r |= hex; } \
-void TOSH_SEL_##name##_IOFUNC() { MSP430REG_NORACE2(r,P##port##SEL); r &= ~hex; }
+void TOSH_SET_##name##_PIN() @safe() { MSP430REG_NORACE2(r,P##port##OUT); r |= hex; } \
+void TOSH_CLR_##name##_PIN() @safe() { MSP430REG_NORACE2(r,P##port##OUT); r &= ~hex; } \
+void TOSH_TOGGLE_##name##_PIN() @safe(){ MSP430REG_NORACE2(r,P##port##OUT); r ^= hex; } \
+uint8_t TOSH_READ_##name##_PIN() @safe() { MSP430REG_NORACE2(r,P##port##IN); return (r & hex); } \
+void TOSH_MAKE_##name##_OUTPUT() @safe() { MSP430REG_NORACE2(r,P##port##DIR); r |= hex; } \
+void TOSH_MAKE_##name##_INPUT() @safe() { MSP430REG_NORACE2(r,P##port##DIR); r &= ~hex; } \
+void TOSH_SEL_##name##_MODFUNC() @safe() { MSP430REG_NORACE2(r,P##port##SEL); r |= hex; } \
+void TOSH_SEL_##name##_IOFUNC() @safe() { MSP430REG_NORACE2(r,P##port##SEL); r &= ~hex; }
 
 #define TOSH_ASSIGN_PIN(name, port, bit) \
 TOSH_ASSIGN_PIN_HEX(name,port,(1<<(bit)))
 
 typedef uint8_t mcu_power_t @combine("mcombine");
-mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) {
+mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) @safe() {
   return (m1 < m2) ? m1: m2;
 }
 enum {
@@ -203,13 +203,13 @@ enum {
   MSP430_POWER_LPM4   = 5
 };
 
-void __nesc_disable_interrupt(void)
+void __nesc_disable_interrupt(void) @safe()
 {
   dint();
   nop();
 }
 
-void __nesc_enable_interrupt(void)
+void __nesc_enable_interrupt(void) @safe()
 {
   eint();
 }
@@ -223,7 +223,7 @@ void __nesc_atomic_end(__nesc_atomic_t reenable_interrupts);
    is #defined, to avoid duplicate functions definitions wheb binary
    components are used. Such functions do need a prototype in all cases,
    though. */
-__nesc_atomic_t __nesc_atomic_start(void) @spontaneous()
+__nesc_atomic_t __nesc_atomic_start(void) @spontaneous() @safe()
 {
   __nesc_atomic_t result = ((READ_SR & SR_GIE) != 0);
   __nesc_disable_interrupt();
@@ -231,7 +231,7 @@ __nesc_atomic_t __nesc_atomic_start(void) @spontaneous()
   return result;
 }
 
-void __nesc_atomic_end(__nesc_atomic_t reenable_interrupts) @spontaneous()
+void __nesc_atomic_end(__nesc_atomic_t reenable_interrupts) @spontaneous() @safe()
 {
   asm volatile("" : : : "memory"); /* ensure atomic section effect visibility */
   if( reenable_interrupts )
index cc10f0c57b7d30c89f0ad98c01e533c3575c357b..2e4087da4989235aec4ab90a109d2f17c4282334 100644 (file)
@@ -29,7 +29,7 @@
  *          intended use.
  */
 
-generic module Msp430InterruptC() {
+generic module Msp430InterruptC() @safe() {
 
   provides interface GpioInterrupt as Interrupt;
   uses interface HplMsp430Interrupt as HplInterrupt;
index 699b0a81ae81a4d522b753d0724a6686e1ba7b76..b67cf95e238f527c6ab6e3cf39be6d8e4855a526 100644 (file)
@@ -34,7 +34,7 @@
  * @version $Revision$ $Date$
  */
 
-generic module Msp430UsartShareP() {
+generic module Msp430UsartShareP() @safe() {
   
   provides interface HplMsp430UsartInterrupts as Interrupts[ uint8_t id ];
   provides interface HplMsp430I2CInterrupts as I2CInterrupts[ uint8_t id ];
index 9f15cd3b50428247b22089a52c92a37096650bbe..e45a7f6a03e88ae5fcce6436d7aee0213e47358e 100644 (file)
@@ -45,7 +45,7 @@
  * @author Kevin Klues (klueska@cs.wustl.edu)
  */
  
-generic module AsyncPowerManagerP() {
+generic module AsyncPowerManagerP() @safe() {
   uses {
     interface AsyncStdControl;
 
index ae0acd7e8ce5299a35adbb229cd1e1a62e25c8aa..b63d96685ab75147ad47ff2817c170d42176d0fa 100644 (file)
@@ -35,7 +35,7 @@
  * @author David Gay
  */
 
-module BusyWaitMicroC
+module BusyWaitMicroC @safe()
 {
   provides interface BusyWait<TMicro,uint16_t>;
 }
index 65eb5ff0ca0518e9ca5640f6889f168ee749d366..a13c40826cfd92bd1badd720a3052835f810d612 100644 (file)
@@ -12,7 +12,7 @@
  * 
  * @author David Gay
  */
-module MotePlatformP
+module MotePlatformP @safe()
 {
   provides interface Init as PlatformInit;
   uses interface GeneralIO as SerialIdPin;
index 899f1f455b079e9b7ce64fb9bad1b627b23d12dc..2a35dda2fe79fcb8a4b1aee8debc896a6c92f91d 100644 (file)
@@ -38,7 +38,7 @@
 #include "Atm128Adc.h"
 #include "CC1000Const.h"
 
-module HplCC1000P {
+module HplCC1000P @safe() {
   provides {
     interface Init as PlatformInit;
     interface HplCC1000;
index 9729889fd09b0b50c9594f456ac4fb21d42cc3e3..cb0fe9d45ff612d0b1e356c4f4134b0ad95b0b63 100644 (file)
@@ -37,7 +37,7 @@
  */
 
 
-module HplCC1000SpiP {
+module HplCC1000SpiP @safe() {
   provides interface Init as PlatformInit;
   provides interface HplCC1000Spi;
   //uses interface PowerManagement;
index c4e667aa7316b238261a54616499de7d7e37b384..a6dba44de116b9d78d5a2af3268f6371f301237b 100644 (file)
@@ -42,7 +42,7 @@
  * @version @version $Revision$ $Date$
  */
 
-module HplCC2420InterruptsP {
+module HplCC2420InterruptsP @safe() {
   provides {
     interface GpioInterrupt as CCA;
   }
index 9b663179c38c3aebc313e5b677d91a4b541b2549..a9104fd54607682047c69893ad9ba4eab2599b58 100644 (file)
@@ -35,7 +35,7 @@
  * @author Miklos Maroti
  */
 
-module HplCC2420SpiP
+module HplCC2420SpiP @safe()
 {
        provides interface Resource;
   
index 62754f8864141704491633ec57926336dfb4d539..8b720fa288fc8ca3fcdfbe99e6b52f33ed703058 100644 (file)
@@ -60,15 +60,15 @@ TOSH_ASSIGN_PIN(GIO3, 2, 6);
 // 1-Wire
 TOSH_ASSIGN_PIN(ONEWIRE, 2, 4);
 
-void HUMIDITY_MAKE_CLOCK_OUTPUT() { TOSH_MAKE_HUM_SCL_OUTPUT(); }
-void HUMIDITY_MAKE_CLOCK_INPUT() { TOSH_MAKE_HUM_SCL_INPUT(); }
-void HUMIDITY_CLEAR_CLOCK() { TOSH_CLR_HUM_SCL_PIN(); }
-void HUMIDITY_SET_CLOCK() { TOSH_SET_HUM_SCL_PIN(); }
-void HUMIDITY_MAKE_DATA_OUTPUT() { TOSH_MAKE_HUM_SDA_OUTPUT(); }
-void HUMIDITY_MAKE_DATA_INPUT() { TOSH_MAKE_HUM_SDA_INPUT(); }
-void HUMIDITY_CLEAR_DATA() { TOSH_CLR_HUM_SDA_PIN(); }
-void HUMIDITY_SET_DATA() { TOSH_SET_HUM_SDA_PIN(); }
-char HUMIDITY_GET_DATA() { return TOSH_READ_HUM_SDA_PIN(); }
+void HUMIDITY_MAKE_CLOCK_OUTPUT() @safe() { TOSH_MAKE_HUM_SCL_OUTPUT(); }
+void HUMIDITY_MAKE_CLOCK_INPUT() @safe() { TOSH_MAKE_HUM_SCL_INPUT(); }
+void HUMIDITY_CLEAR_CLOCK() @safe() { TOSH_CLR_HUM_SCL_PIN(); }
+void HUMIDITY_SET_CLOCK() @safe() { TOSH_SET_HUM_SCL_PIN(); }
+void HUMIDITY_MAKE_DATA_OUTPUT() @safe() { TOSH_MAKE_HUM_SDA_OUTPUT(); }
+void HUMIDITY_MAKE_DATA_INPUT() @safe() { TOSH_MAKE_HUM_SDA_INPUT(); }
+void HUMIDITY_CLEAR_DATA() @safe() { TOSH_CLR_HUM_SDA_PIN(); }
+void HUMIDITY_SET_DATA() @safe() { TOSH_SET_HUM_SDA_PIN(); }
+char HUMIDITY_GET_DATA() @safe() { return TOSH_READ_HUM_SDA_PIN(); }
 
 #define HUMIDITY_TIMEOUT_MS          30
 #define HUMIDITY_TIMEOUT_TRIES       20
index 1501ec6afc9ce1a75240b62fba3159cf9b59e2a6..237b7fb0ffe63e49b3e593cdb156a82d5f37b278 100644 (file)
@@ -20,7 +20,7 @@
  *
  * @author David Gay
  */
-generic module ArbitratedReadC(typedef width_t) {
+generic module ArbitratedReadC(typedef width_t) @safe() {
   provides interface Read<width_t>[uint8_t client];
   uses {
     interface Read<width_t> as Service[uint8_t client];
index eb87214cf81f1145e3913af4af5f34f16c25d608..0ef68bc10ceb6ab32c3c307f636f55eb60521717 100644 (file)
@@ -13,7 +13,7 @@
  *
  * @author David Gay <david.e.gay@intel.com>
  */
-module NoInitC 
+module NoInitC @safe()
 {
   provides interface Init;
 }
index d2805a6427b2ad2966930aa8fb5ac96ffdf82737..ca23c8a4040478e9afb5e8b4f110deb94e76b11e 100644 (file)
@@ -29,7 +29,7 @@
  
 #include "Resource.h"
  
-generic module RoundRobinResourceQueueC(uint8_t size) {
+generic module RoundRobinResourceQueueC(uint8_t size) @safe() {
   provides {
     interface Init;
     interface ResourceQueue as RoundRobinQueue;
index 91d883a0bce74daf3b097ebe5d4437be276496be..ac4c839e40c6660866a555f1ad0e346a39229b67 100644 (file)
@@ -46,7 +46,7 @@
  * @author Philip Levis
  */
  
-generic module SimpleArbiterP() {
+generic module SimpleArbiterP() @safe() {
   provides {
     interface Resource[uint8_t id];
     interface ResourceRequested[uint8_t id];
index c039ac8d8497a79184f5cf473690c32ae6c83b52..b9767ae6580d1366c185991b1d6ecb8c82d683a0 100644 (file)
@@ -55,7 +55,7 @@ enum {
 
 typedef uint8_t error_t NESC_COMBINE("ecombine");
 
-error_t ecombine(error_t r1, error_t r2)
+error_t ecombine(error_t r1, error_t r2) @safe()
 /* Returns: r1 if r1 == r2, FAIL otherwise. This is the standard error
      combination function: two successes, or two identical errors are
      preserved, while conflicting errors are represented by FAIL.