This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Attributes to local varables of class


Brij Bihari Pandey <fuzzhead012@yahoo.com> writes:

> hi,
> 
> In "packages/kernel/current/include/intr.hxx", class
> Cyg_Interrupt, this small section puzzles me --
> 
> -----------------------------------------------------
> #ifdef CYGIMP_KERNEL_INTERRUPTS_DSRS_LIST
> 
> // Number of DSR posts made
> volatile cyg_ucount32 dsr_count
> CYGBLD_ANNOTATE_VARIABLE_INTR; 
> 
> // next DSR in list
> Cyg_Interrupt* volatile next_dsr
> CYGBLD_ANNOTATE_VARIABLE_INTR; 
> 
> // static list of pending DSRs
> static Cyg_Interrupt* volatile
> dsr_list[CYGNUM_KERNEL_CPU_MAX]
> CYGBLD_ANNOTATE_VARIABLE_INTR;
>     
> #endif
> --------------------------------------------------
> I am puzzled about - if this code functions then it
> allows me to have data local to a class object,
> sitting somewhere outside the object. As far as my
> simple knowledge about c++ goes. it can't be possible.
> 
> 
> Is attribute specification with local members
> dsr_count  and next_dsr something that has somehow got
> ignored
> OR
> these variables were also intended to be static like
> dsr_list
> 
> hope that someone can clear this puzzle.
> thanks
> brij

I added these annotations some time ago to support a platform that
had a very steep timing difference between a very small CPU-local RAM
area and the main part of RAM. The idea was to move some critical
static data into the local RAM for better performance.

It looks like you have found a place where I was being a little too
enthusiatic with adding the annotations. They are indeed not necessary
on dsr_count and next_dsr. However, the annotations have no effect in
this case.


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]