Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » RTSC types
RTSC types [message #443270] Fri, 31 July 2009 10:29 Go to next message
Patrick Geremia is currently offline Patrick Geremia
Messages: 79
Registered: July 2009
Member
According to the RTSC datatypes Int8 corresponds to int_least8_t or
int_fast8_t
Bits8 on the contrary maps to int8_t (and int8_t is exactly 8 bits as per
C standard).

So when using Int8 from RTSC, you could use 8 or 32 bit data type
depending on the platform / compiler mapping of int_least8_t /
int_fast8_t.

So to make sure you use 8 bits then you have to use Bits8.

TI has been using the tistdtypes.h where Int8 is 8 bit. When switching to
RTSC types I am sure they will continue to use Int8 thinking it maps to
exactly 8 bits but this is not the case (Int8 maps to int_least8_t or
int_fast8_t). This is quite confusing.

Any comments.
Re: RTSC types [message #443948 is a reply to message #443270] Fri, 31 July 2009 12:03 Go to previous message
Dave Russo is currently offline Dave Russo
Messages: 172
Registered: July 2009
Senior Member
Patrick Geremia wrote:
> According to the RTSC datatypes Int8 corresponds to int_least8_t or
> int_fast8_t
> Bits8 on the contrary maps to int8_t (and int8_t is exactly 8 bits as
> per C standard).
>
> So when using Int8 from RTSC, you could use 8 or 32 bit data type
> depending on the platform / compiler mapping of int_least8_t / int_fast8_t.
> So to make sure you use 8 bits then you have to use Bits8.
> TI has been using the tistdtypes.h where Int8 is 8 bit. When switching
> to RTSC types I am sure they will continue to use Int8 thinking it maps
> to exactly 8 bits but this is not the case (Int8 maps to int_least8_t or
> int_fast8_t). This is quite confusing.
> Any comments.
>
>
The choice of the type names Int8, Int16, and Int32 was richly debated
by DSP/BIOS team and the TII CSL/PSP teams.

We eventually reached agreement in the names defined in RTSC. Some of
the considerations included (but were not limited to):
1. use of the exact types is not portable to many TI devices
(C30/C40, C50, C28, ...), so they should be avoided in any API
that is expected to be called from "portable" code.
2. most "high-level" code does not need exact sizes, but does need
to assert a minimum range of values.
3. for a period in time, the BIOS/SPOX types LgInt, MdInt, and SmInt
(which correspond to the int_least{32,16,8}_t types) were mapped
Int32, Int16, and Int8.
4. Every development group creates aliases for the long C99 type
names as part of their coding conventions and chooses the "good
names" for the common types. Since RTSC tries to encourage
portable C in a diverse HW environment, we choose Int{8,16,32}
to be types that can be supported on virtually all architectures.

Standardizing types names has proven to be incredibly difficult; there
is no obviously right answer and therefore no consensus among seasoned
developers who often have good but contradictory proposals.

In the end, we decided that we simply had to choose something and
carefully document the semantics of our types.
Previous Topic:statically inserting an instance handle into another module's mod state
Next Topic:registration free download of XDCtools is now available
Goto Forum:
  


Current Time: Fri Aug 22 07:54:37 EDT 2014

Powered by FUDForum. Page generated in 0.02058 seconds