mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-02-21 15:19:47 -05:00
fw: No .data or .bss segment
We don't use any .data or .bss segment at all to keep all the firmware variables in the stack in protected fw_ram. Signed-off-by: Daniel Lublin <daniel@lublin.se>
This commit is contained in:
parent
56e34b3add
commit
d77654bb8e
@ -40,6 +40,8 @@ SECTIONS
|
|||||||
_sidata = _etext;
|
_sidata = _etext;
|
||||||
} >ROM
|
} >ROM
|
||||||
|
|
||||||
|
/* XXX We don't allow any data or BSS - but they need be defined or linking will fail */
|
||||||
|
|
||||||
.data : AT (_etext)
|
.data : AT (_etext)
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
@ -51,7 +53,7 @@ SECTIONS
|
|||||||
*(.sdata*) /* .sdata* sections */
|
*(.sdata*) /* .sdata* sections */
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
} >RAM
|
} >ROM
|
||||||
|
|
||||||
/* Uninitialized data section */
|
/* Uninitialized data section */
|
||||||
.bss :
|
.bss :
|
||||||
@ -66,6 +68,5 @@ SECTIONS
|
|||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} >RAM
|
} >ROM
|
||||||
/* Init stack to _ebss + size */
|
|
||||||
}
|
}
|
||||||
|
@ -51,31 +51,6 @@ clear:
|
|||||||
*/
|
*/
|
||||||
li sp, 0xd00003f0 // 1 kiB - 16 byte in FW_RAM
|
li sp, 0xd00003f0 // 1 kiB - 16 byte in FW_RAM
|
||||||
|
|
||||||
/* copy data section */
|
|
||||||
la a0, _sidata
|
|
||||||
la a1, _sdata
|
|
||||||
la a2, _edata
|
|
||||||
bge a1, a2, end_init_data
|
|
||||||
|
|
||||||
loop_init_data:
|
|
||||||
lw a3, 0(a0)
|
|
||||||
sw a3, 0(a1)
|
|
||||||
addi a0, a0, 4
|
|
||||||
addi a1, a1, 4
|
|
||||||
blt a1, a2, loop_init_data
|
|
||||||
|
|
||||||
end_init_data:
|
|
||||||
/* zero-init bss section */
|
|
||||||
la a0, _sbss
|
|
||||||
la a1, _ebss
|
|
||||||
bge a0, a1, end_init_bss
|
|
||||||
|
|
||||||
loop_init_bss:
|
|
||||||
sw zero, 0(a0)
|
|
||||||
addi a0, a0, 4
|
|
||||||
blt a0, a1, loop_init_bss
|
|
||||||
|
|
||||||
end_init_bss:
|
|
||||||
call main
|
call main
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user