Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Align Command Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
Align CommandAlign specifies the default alignment for the mapping process: Align = Value The starting address of each entity to be mapped is rounded up to a multiple of Parameter Value, which must be a power of two. The smallest supported value is 4, the default is 4096 (one page). Note that you can override the alignment in each Locate command. RTLoc uses one page as the default alignment to make sure that each page will never be used by more than one program entity. This allows optimum page protection. For example, assume you have a CODE and a DATA section located to the same region. Code usually has read only access while data needs read/write access. If the alignment is less than one page, the start of DATA could be located in the same page as the end of CODE, forcing the access for that particular page to have the higher value (read/write). Thus, parts of your code would not be protected from write accesses. Of course, the disadvantage of using a large alignment value is wasted memory. For example, if the next available address of a region is just one byte following a page boundary, 4095 bytes are wasted to map a new entity.
|