Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » MSPGCC
  • » [Mspgcc-users] Type Defining Reentrant Functions [RSS Feed]

#1 Oct. 29, 2005 01:53:56

Ram K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] Type Defining Reentrant Functions


Hi,I am working on MSP4301611 and using msp430-gcc version 3.2. Iam interested in using function pointers within my application. Do Ineed to mark the functions that would be accessed through functionpointers as reentrant ?Also what is the syntax for defining a pointer to a reentrant function.
I have tried many variations of the following but with no success.

typedef int (*func_ptr_t)(int x) __attribute__((reentrant));

Any help would be greatly appreciated.

Thanks,
-Ram

Offline

#2 Oct. 29, 2005 11:17:43

N. C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] Type Defining Reentrant Functions


At 17:53 28-10-05 -0700, you wrote:
>Hi,
> I am working on MSP4301611 and using msp430-gcc version 3.2. I
>am interested in using function pointers within my application. Do I
>need to mark the functions that would be accessed through function
>pointers as reentrant ?

You don't have to mark those functions as reentrant. The reentrant
attribute causes a function to disable interrupts on entry and enable
interrupts on exit. I suppose you refer to recursive programming. This is
no problem in the MSP430 architecture and doesn't require special function
attributes.

>Also what is the syntax for defining a pointer to a reentrant function.
>I have tried many variations of the following but with no success.
>
>typedef int (*func_ptr_t)(int x) __attribute__((reentrant));

Being reentrant has to do with the way the function is compiled, so you
should only mark the function body (the actual implementation) as reentrant.

Nico Coesel

Offline

  • Root
  • » MSPGCC
  • » [Mspgcc-users] Type Defining Reentrant Functions [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support