Dear Aneesh V,

In message <4e0030f8.6030...@ti.com> you wrote:
> 
> I am finding it difficult to implement this using the struct based
> approach. I tried the sample code below:
> 
> struct my_regs_struct {
>       const unsigned int reg1;
>       const unsigned int reg2;
>       const unsigned int reg3;
> };
> 
> static struct my_regs_struct *const my_regs = (struct my_regs_struct 
> *)0x1000;
> 
> static unsigned int *const reg_arr[] = {
>       &my_regs->reg1,
>       &my_regs->reg3
> };
> 
> void main(void)
> {
>       printf("regs %x %x \n", reg_arr[0], reg_arr[1]);
> }

Sorry, but I fail to understand the problem.  Why is reg_arr[] needed?
Why don't you use

        struct my_regs_struct {
                const unsigned int reg[3];
        };
?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
But it's real. And if it's real it can be affected ... we may not  be
able  to break it, but, I'll bet you credits to Navy Beans we can put
a dent in it.
        -- deSalle, "Catspaw", stardate 3018.2
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to