[ECOS] A simple data type question
Trenton D. Adams
tadams@extremeeng.com
Tue Jun 12 07:21:00 GMT 2001
It all depends on the word size of your platform. If you have a 32 bit
word, then unsigned should be a 32-bit unsigned integer. If however
your word is 16-bits, then unsigned would be 16-bit. I suppose it could
depend on the compiler too, but I think it's a standard to go by the
word size of the CPU in use.
Since a #define is just a macro, and replaces any place it occurs with
the defined statement, you would have to use a type cast like the
example you gave. So, if your CPU uses a 16-bit word, then you would
need to go
#define IOPDATA ((unsigned long *)0x0)
Someone tell me if I'm wrong! :)
-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[ mailto:ecos-discuss-owner@sources.redhat.com ] On Behalf Of HuangQiang
Sent: Tuesday, June 12, 2001 2:57 AM
To: eCos
Subject: [ECOS] A simple data type question
Hi all:
Could anyone give me some detail about the following statement:
#define IOPDATA ((volatile unsigned *)(SYSCFG + 0x5008))
if I change the *IOPDATA = 0x0; then how many bit can I change . what
data width is the (volatile unsigned *)? if I want to use a 32-bit width
pointer how can I do it?
Thanks all.
More information about the Ecos-discuss
mailing list