This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How can i import a lib twice

because projects need, i have to import ?C?LIB_CODE twice.(One LIB_CODE start at 0xF80000, another start at 0xFD0000). The usr code call function in LIB_CODE which is in 0xF80000, sys code call functions in LIB_CODE which is in 0xFD0000. For the needs , how can i do that, please help.....

Parents
  • I have to import two same lib. Because the user code can't call the sys code except use "trap". User code and sys code both call LIB_Code, so we need to locate LIB_CODE in both two area to avoid simple directive use "trap" for example 32bit mul or div.
    I don't know the Explanation is clear?

Reply
  • I have to import two same lib. Because the user code can't call the sys code except use "trap". User code and sys code both call LIB_Code, so we need to locate LIB_CODE in both two area to avoid simple directive use "trap" for example 32bit mul or div.
    I don't know the Explanation is clear?

Children
  • You will not be able to get the compiler to sometimes produce calls to a function stored at address 1, and sometimes call a function stored at address 2.

    If you want the sys code to be completely separate from the main code, then you should restructure your projects so you create two separate binaries - with separate load addresses etc. Then merge the binaries when programming the chip.

    I haven't worked with any 251 chip - but has that processor really two completely separate code spaces for system code and user code? Because if it doesn't, then system code can call a specific function, and the normal code can call the same function - all without any special things needed.

    It's only if the function does something that requires system mode that the user-mode code can't call the function - at all - but have to make use of some form of call gate to get the processor into system mode.

  • we apply mmu to 251 core
    mmu will check the code addr with some rules, if it is illegal, mmu will refuse.
    thank you