jwestmoreland wrote on Wednesday, October 17, 2007:
I think I should have worded, "and obviates" - to "could obviate".
I was a little unclear on this myself - evidently IAR limits you to one PDATA page at link-time - but you can switch PDATA
pages using: (according to a reliable source:)
"The C8051F120 has 16 pages of PDATA space. The datasheet refers to this space as XRAM. Switching between pages is accomplished by setting the PGSELx bits in the EMI0CN SFR. In assembly, this can be accomplished by a “mov” instruction, which will take 3 clock cycles."
Someone mentioned to me this could obviate the XRAM copy step - in reality, as you point out - I don’t think it does.
I think the person that mentioned this to me thought everything could be declared __pdata_reentrant with the IAR compiler - but
didn’t think about the hardware stack in IDATA. Since the IAR compiler has it’s own routines to copy stacks for the reentrant functions - I think the thinking was/is if a task can be assigned a PDATA page - that the task contexts could be paged effectively.
I suppose this could be done - but you still have the to/from copy step to the PDATA page that has to be done. This is also not a good use of XRAM if your app. becomes somewhat XRAM limited.