stack, cosmetic

This commit is contained in:
froloffw7 2024-01-12 20:08:00 +01:00 committed by GitHub
parent 79f7da9991
commit d036d51e67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 8 deletions

View file

@ -11,7 +11,7 @@
.file "phy6222_start.s"
/* *.ld: g_top_irqstack = ORIGIN(sram) + LENGTH(sram) */
.global g_top_irqstack
.global g_stack
.text
.align 2
@ -21,14 +21,14 @@
.type __start, %function
__start:
ldr r1, = g_top_irqstack
ldr r1, = g_irqstack_top
msr msp, r1 /* r2>>sp */
bl c_start /* R0=IRQ, R1=register save area on stack */
.size __start, .-__start
#if 0 // Implemented in phy6222_vectors.c
.section .isr_vector
.align 4
.globl __Vectors
@ -38,7 +38,17 @@ __Vectors:
.long __start
.size __Vectors, . - __Vectors
#endif
.section .irq_stack
.align 4
.global g_irqstack_base
.global g_irqstack_top
g_irqstack_base:
.space 0x400
g_irqstack_top:
.end

View file

@ -1,15 +1,13 @@
#define locate_data(n) __attribute__ ((section(n)))
extern unsigned int g_top_irqstack;
extern unsigned int g_irqstack_top;
extern void __start(void);
const unsigned _vectors[] locate_data(".isr_vector") =
{
/* Initial stack */
(unsigned)(&g_top_irqstack),
(unsigned)(&g_irqstack_top),
/* Reset exception handler */
(unsigned)& __start,
(unsigned)(&__start),
};