@@ -55,8 +55,41 @@ SECTIONS
55
55
. = ALIGN (4);
56
56
} > FLASH_PROTECTION
57
57
58
+ /* Ensure that the uVisor .bss is the first section in the public SRAM. */
59
+ .uvisor.bss (NOLOAD) :
60
+ {
61
+ . = ALIGN (32);
62
+ __uvisor_bss_start = .;
63
+
64
+ /* uVisor main .bss (protected) */
65
+ . = ALIGN (32);
66
+ __uvisor_bss_main_start = .;
67
+ KEEP(*(.keep.uvisor.bss.main))
68
+ . = ALIGN (32);
69
+ __uvisor_bss_main_end = .;
70
+
71
+ /* Secure boxes .bss (protected) */
72
+ . = ALIGN (32);
73
+ __uvisor_bss_boxes_start = .;
74
+ KEEP(*(.keep.uvisor.bss.boxes))
75
+ . = ALIGN (32);
76
+ __uvisor_bss_boxes_end = .;
77
+
78
+ . = ALIGN (32);
79
+ __uvisor_bss_end = .;
80
+ } > RAM
81
+
58
82
.text :
59
83
{
84
+ /* uVisor code and data */
85
+ /* Note : This is the location of the uVisor binary in flash. Make sure
86
+ * this position correspond to the FLASH_OFFSET set in the uVisor
87
+ * configuration. */
88
+ . = ALIGN (4);
89
+ __uvisor_main_start = .;
90
+ *(.uvisor.main)
91
+ __uvisor_main_end = .;
92
+
60
93
*(.text*)
61
94
62
95
KEEP(*(.init))
@@ -93,10 +126,10 @@ SECTIONS
93
126
} > FLASH
94
127
__exidx_end = .;
95
128
96
- __etext = .;
97
-
98
- .data : AT (__etext)
129
+ .data :
99
130
{
131
+ PROVIDE ( __etext = LOADADDR (.data) );
132
+
100
133
__data_start__ = .;
101
134
*(vtable)
102
135
*(.data*)
@@ -126,7 +159,32 @@ SECTIONS
126
159
/* All data end */
127
160
__data_end__ = .;
128
161
129
- } > RAM
162
+ } > RAM AT>FLASH
163
+
164
+ /* uVisor configuration data */
165
+ .uvisor.secure :
166
+ {
167
+ . = ALIGN (32);
168
+ __uvisor_secure_start = .;
169
+
170
+ /* Secure boxes configuration tables (protected) */
171
+ . = ALIGN (32);
172
+ __uvisor_cfgtbl_start = .;
173
+ KEEP(*(.keep.uvisor.cfgtbl))
174
+ . = ALIGN (32);
175
+ __uvisor_cfgtbl_end = .;
176
+
177
+ /* Pointers to the secure boxes configuration tables (protected) */
178
+ /* Note : Do not add any further alignment here, as we use this pointer
179
+ * table to enumerate boxes. */
180
+ __uvisor_cfgtbl_ptr_start = .;
181
+ KEEP(*(.keep.uvisor.cfgtbl_ptr_first))
182
+ KEEP(*(.keep.uvisor.cfgtbl_ptr))
183
+ __uvisor_cfgtbl_ptr_end = .;
184
+
185
+ . = ALIGN (32);
186
+ __uvisor_secure_end = .;
187
+ } >FLASH
130
188
131
189
.bss :
132
190
{
@@ -160,5 +218,13 @@ SECTIONS
160
218
161
219
/* Check if data + heap + stack exceeds RAM limit */
162
220
ASSERT (__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
221
+
222
+ /* Provide physical memory boundaries for uVisor. */
223
+ __uvisor_flash_start = ORIGIN (VECTORS);
224
+ __uvisor_flash_offset = ORIGIN (FLASH);
225
+ __uvisor_flash_end = ORIGIN (FLASH) + LENGTH (FLASH);
226
+ __uvisor_sram_start = ORIGIN (RAM) - 0x200;
227
+ __uvisor_sram_offset = ORIGIN (RAM);
228
+ __uvisor_sram_end = ORIGIN (RAM) + LENGTH (RAM);
163
229
}
164
230
0 commit comments