From b270325d9a4a0144b3035396fa6bb0e40b48de4e Mon Sep 17 00:00:00 2001 From: idgay Date: Mon, 8 Oct 2007 20:10:05 +0000 Subject: [PATCH] don't use __attribute__ for nesC attributes --- tos/chips/atm128/sim/atm128hardware.h | 8 ++++---- tos/chips/cc1000_lpl/LowPowerListening.nc | 2 ++ tos/chips/msp430/msp430hardware.h | 4 ++-- tos/chips/pxa27x/pxa27xhardware.h | 4 ++-- tos/lib/tosboot/TOSBootM.nc | 2 +- tos/lib/tosboot/micaz/avrhardware.h | 8 ++++---- tos/lib/tossim/SimMainP.nc | 2 +- tos/lib/tossim/SimMoteP.nc | 18 +++++++++--------- tos/lib/tossim/TossimActiveMessageC.nc | 2 +- tos/system/RealMainP.nc | 2 +- tos/types/TinyError.h | 2 +- 11 files changed, 28 insertions(+), 26 deletions(-) diff --git a/tos/chips/atm128/sim/atm128hardware.h b/tos/chips/atm128/sim/atm128hardware.h index a959ceb5..482a87fb 100644 --- a/tos/chips/atm128/sim/atm128hardware.h +++ b/tos/chips/atm128/sim/atm128hardware.h @@ -48,10 +48,10 @@ uint8_t atm128RegFile[TOSSIM_MAX_NODES][0xa0]; /* We need slightly different defs than SIGNAL, INTERRUPT */ #define AVR_ATOMIC_HANDLER(signame) \ - void signame() __attribute__ ((spontaneous, C)) + void signame() @spontaneous() @C() #define AVR_NONATOMIC_HANDLER(signame) \ - void signame() __attribute__ ((spontaneous, C)) + void signame() @spontaneous() @C() /* Macro to create union casting functions. */ #define DEFINE_UNION_CAST(func_name, from_type, to_type) \ @@ -89,7 +89,7 @@ typedef uint8_t __nesc_atomic_t; /* Saves current interrupt mask state and disables interrupts. */ inline __nesc_atomic_t -__nesc_atomic_start(void) __attribute__((spontaneous)) +__nesc_atomic_start(void) @spontaneous() { __nesc_atomic_t result = SREG; __nesc_disable_interrupt(); @@ -98,7 +98,7 @@ __nesc_atomic_start(void) __attribute__((spontaneous)) /* Restores interrupt mask to original state. */ inline void -__nesc_atomic_end(__nesc_atomic_t original_SREG) __attribute__((spontaneous)) +__nesc_atomic_end(__nesc_atomic_t original_SREG) @spontaneous() { SREG = original_SREG; } diff --git a/tos/chips/cc1000_lpl/LowPowerListening.nc b/tos/chips/cc1000_lpl/LowPowerListening.nc index 8bd970fe..a9c0df02 100644 --- a/tos/chips/cc1000_lpl/LowPowerListening.nc +++ b/tos/chips/cc1000_lpl/LowPowerListening.nc @@ -36,6 +36,8 @@ * @author Jonathan Hui */ +#include + interface LowPowerListening { /** diff --git a/tos/chips/msp430/msp430hardware.h b/tos/chips/msp430/msp430hardware.h index f2559022..1a5cc8b9 100644 --- a/tos/chips/msp430/msp430hardware.h +++ b/tos/chips/msp430/msp430hardware.h @@ -146,11 +146,11 @@ MSP430REG_NORACE2(I2CDCTLnr,I2CDCTL); // The signal attribute has opposite meaning in msp430-gcc than in avr-gcc #define TOSH_SIGNAL(signame) \ -void sig_##signame() __attribute__((interrupt (signame), wakeup, C)) + void sig_##signame() __attribute__((interrupt (signame), wakeup)) @C() // TOSH_INTERRUPT allows nested interrupts #define TOSH_INTERRUPT(signame) \ -void isr_##signame() __attribute__((interrupt (signame), signal, wakeup, C)) + void isr_##signame() __attribute__((interrupt (signame), signal, wakeup)) @C() #define SET_FLAG(port, flag) ((port) |= (flag)) diff --git a/tos/chips/pxa27x/pxa27xhardware.h b/tos/chips/pxa27x/pxa27xhardware.h index 04d056ba..1f377bf5 100644 --- a/tos/chips/pxa27x/pxa27xhardware.h +++ b/tos/chips/pxa27x/pxa27xhardware.h @@ -92,7 +92,7 @@ inline uint32_t _pxa27x_clzui(uint32_t i) { typedef uint32_t __nesc_atomic_t; //NOTE...at the moment, these functions will ONLY disable the IRQ...FIQ is left alone -inline __nesc_atomic_t __nesc_atomic_start(void) __attribute__((spontaneous)) +inline __nesc_atomic_t __nesc_atomic_start(void) @spontaneous() { uint32_t result = 0; uint32_t temp = 0; @@ -108,7 +108,7 @@ inline __nesc_atomic_t __nesc_atomic_start(void) __attribute__((spontaneous)) return result; } -inline void __nesc_atomic_end(__nesc_atomic_t oldState) __attribute__((spontaneous)) +inline void __nesc_atomic_end(__nesc_atomic_t oldState) @spontaneous() { uint32_t statusReg = 0; //make sure that we only mess with the INT bit diff --git a/tos/lib/tosboot/TOSBootM.nc b/tos/lib/tosboot/TOSBootM.nc index 8b4eba70..2f9d242e 100644 --- a/tos/lib/tosboot/TOSBootM.nc +++ b/tos/lib/tosboot/TOSBootM.nc @@ -250,7 +250,7 @@ implementation { } - int main() __attribute__ ((C, spontaneous)) { + int main() @C() @spontaneous() { __nesc_disable_interrupt(); diff --git a/tos/lib/tosboot/micaz/avrhardware.h b/tos/lib/tosboot/micaz/avrhardware.h index 15a3e87d..0dde2a1e 100644 --- a/tos/lib/tosboot/micaz/avrhardware.h +++ b/tos/lib/tosboot/micaz/avrhardware.h @@ -133,10 +133,10 @@ static inline void TOSH_MAKE_##alias##_INPUT() {TOSH_MAKE_##connector##_INPUT() // We need slightly different defs than SIGNAL, INTERRUPT #define TOSH_SIGNAL(signame) \ -void signame() __attribute__ ((signal, spontaneous, C)) + void signame() __attribute__ ((signal)) @spontaneous() @C() #define TOSH_INTERRUPT(signame) \ -void signame() __attribute__ ((interrupt, spontaneous, C)) + void signame() __attribute__ ((interrupt)) @spontaneous() @C() /* Watchdog Prescaler */ @@ -166,14 +166,14 @@ void TOSH_wait() /* #ifndef NESC_BUILD_BINARY */ -/* inline __nesc_atomic_t __nesc_atomic_start(void) __attribute__((spontaneous)) */ +/* inline __nesc_atomic_t __nesc_atomic_start(void) @spontaneous() */ /* { */ /* __nesc_atomic_t result = inp(SREG); */ /* cli(); */ /* return result; */ /* } */ -/* inline void __nesc_atomic_end(__nesc_atomic_t oldSreg) __attribute__((spontaneous)) */ +/* inline void __nesc_atomic_end(__nesc_atomic_t oldSreg) @spontaneous() */ /* { */ /* outp(oldSreg, SREG); */ /* } */ diff --git a/tos/lib/tossim/SimMainP.nc b/tos/lib/tossim/SimMainP.nc index 66fad992..aa54d3ff 100644 --- a/tos/lib/tossim/SimMainP.nc +++ b/tos/lib/tossim/SimMainP.nc @@ -40,7 +40,7 @@ module SimMainP { } implementation { - int sim_main_start_mote() __attribute__ ((C, spontaneous)) { + int sim_main_start_mote() @C() @spontaneous() { char timeBuf[128]; atomic { /* First, initialize the Scheduler so components can post diff --git a/tos/lib/tossim/SimMoteP.nc b/tos/lib/tossim/SimMoteP.nc index bea63ddd..fc6071c3 100644 --- a/tos/lib/tossim/SimMoteP.nc +++ b/tos/lib/tossim/SimMoteP.nc @@ -79,7 +79,7 @@ implementation { } - long long int sim_mote_euid(int mote) __attribute__ ((C, spontaneous)) { + long long int sim_mote_euid(int mote) @C() @spontaneous() { long long int result; int tmp = sim_node(); sim_set_node(mote); @@ -88,14 +88,14 @@ implementation { return result; } - void sim_mote_set_euid(int mote, long long int id) __attribute__ ((C, spontaneous)) { + void sim_mote_set_euid(int mote, long long int id) @C() @spontaneous() { int tmp = sim_node(); sim_set_node(mote); call SimMote.setEuid(id); sim_set_node(tmp); } - long long int sim_mote_start_time(int mote) __attribute__ ((C, spontaneous)) { + long long int sim_mote_start_time(int mote) @C() @spontaneous() { long long int result; int tmp = sim_node(); sim_set_node(mote); @@ -104,7 +104,7 @@ implementation { return result; } - int sim_mote_get_variable_info(int mote, char* name, void** ptr, size_t* len) __attribute__ ((C, spontaneous)) { + int sim_mote_get_variable_info(int mote, char* name, void** ptr, size_t* len) @C() @spontaneous() { int result; int tmpID = sim_node(); sim_set_node(mote); @@ -114,7 +114,7 @@ implementation { return result; } - void sim_mote_set_start_time(int mote, long long int t) __attribute__ ((C, spontaneous)) { + void sim_mote_set_start_time(int mote, long long int t) @C() @spontaneous() { int tmpID = sim_node(); sim_set_node(mote); startTime = t; @@ -123,7 +123,7 @@ implementation { return; } - bool sim_mote_is_on(int mote) __attribute__ ((C, spontaneous)) { + bool sim_mote_is_on(int mote) @C() @spontaneous() { bool result; int tmp = sim_node(); sim_set_node(mote); @@ -132,14 +132,14 @@ implementation { return result; } - void sim_mote_turn_on(int mote) __attribute__ ((C, spontaneous)) { + void sim_mote_turn_on(int mote) @C() @spontaneous() { int tmp = sim_node(); sim_set_node(mote); call SimMote.turnOn(); sim_set_node(tmp); } - void sim_mote_turn_off(int mote) __attribute__ ((C, spontaneous)) { + void sim_mote_turn_off(int mote) @C() @spontaneous() { int tmp = sim_node(); sim_set_node(mote); call SimMote.turnOff(); @@ -155,7 +155,7 @@ implementation { call SimMote.turnOn(); } - void sim_mote_enqueue_boot_event(int mote) __attribute__ ((C, spontaneous)) { + void sim_mote_enqueue_boot_event(int mote) @C() @spontaneous() { int tmp = sim_node(); sim_set_node(mote); diff --git a/tos/lib/tossim/TossimActiveMessageC.nc b/tos/lib/tossim/TossimActiveMessageC.nc index 2c178628..dd183fc2 100644 --- a/tos/lib/tossim/TossimActiveMessageC.nc +++ b/tos/lib/tossim/TossimActiveMessageC.nc @@ -243,7 +243,7 @@ implementation { return evt; } - void active_message_deliver(int node, message_t* msg, sim_time_t t) __attribute__ ((C, spontaneous)) { + void active_message_deliver(int node, message_t* msg, sim_time_t t) @C() @spontaneous() { sim_event_t* evt = allocate_deliver_event(node, msg, t); sim_queue_insert(evt); } diff --git a/tos/system/RealMainP.nc b/tos/system/RealMainP.nc index 22e77d31..ad969181 100644 --- a/tos/system/RealMainP.nc +++ b/tos/system/RealMainP.nc @@ -49,7 +49,7 @@ module RealMainP { uses interface Init as SoftwareInit; } implementation { - int main() __attribute__ ((C, spontaneous)) { + int main() @C() @spontaneous() { atomic { /* First, initialize the Scheduler so components can post diff --git a/tos/types/TinyError.h b/tos/types/TinyError.h index d733a426..02249bc2 100644 --- a/tos/types/TinyError.h +++ b/tos/types/TinyError.h @@ -44,7 +44,7 @@ enum { EALREADY = 9, // The device state you are requesting is already set }; -typedef uint8_t error_t __attribute__((combine(ecombine))); +typedef uint8_t error_t @combine("ecombine"); error_t ecombine(error_t r1, error_t r2) /* Returns: r1 if r1 == r2, FAIL otherwise. This is the standard error -- 2.39.2