Commit bdb774df authored by Sandrine Bailleux's avatar Sandrine Bailleux Committed by Dan Handley
Browse files

Fix SPSR register size in gp_regs structure

SPSR is a 32-bit register and so its size should be reflected in
the gp_regs structure.  This patch fixes the type of gp_regs.spsr
to use a 32-bit variable.  It also makes the size of the other
register fields more explicit.

Change-Id: I27e0367df1a91cc501d5217c1b3856d4097c60ba
parent a960f282
...@@ -115,43 +115,43 @@ ...@@ -115,43 +115,43 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
typedef struct { typedef struct {
unsigned long x0; uint64_t x0;
unsigned long x1; uint64_t x1;
unsigned long x2; uint64_t x2;
unsigned long x3; uint64_t x3;
unsigned long x4; uint64_t x4;
unsigned long x5; uint64_t x5;
unsigned long x6; uint64_t x6;
unsigned long x7; uint64_t x7;
unsigned long x8; uint64_t x8;
unsigned long x9; uint64_t x9;
unsigned long x10; uint64_t x10;
unsigned long x11; uint64_t x11;
unsigned long x12; uint64_t x12;
unsigned long x13; uint64_t x13;
unsigned long x14; uint64_t x14;
unsigned long x15; uint64_t x15;
unsigned long x16; uint64_t x16;
unsigned long x17; uint64_t x17;
unsigned long x18; uint64_t x18;
unsigned long x19; uint64_t x19;
unsigned long x20; uint64_t x20;
unsigned long x21; uint64_t x21;
unsigned long x22; uint64_t x22;
unsigned long x23; uint64_t x23;
unsigned long x24; uint64_t x24;
unsigned long x25; uint64_t x25;
unsigned long x26; uint64_t x26;
unsigned long x27; uint64_t x27;
unsigned long x28; uint64_t x28;
unsigned long sp_el0; uint64_t sp_el0;
unsigned long spsr; uint32_t spsr;
/* /*
* Alignment constraint which allows save & restore of fp & lr on the * Alignment constraint which allows save & restore of fp & lr on the
* stack during exception handling * stack during exception handling
*/ */
unsigned long fp __attribute__((__aligned__(16))); uint64_t fp __attribute__((__aligned__(16)));
unsigned long lr; uint64_t lr;
} __attribute__((__aligned__(16))) gp_regs; } __attribute__((__aligned__(16))) gp_regs;
/******************************************************************************* /*******************************************************************************
......
...@@ -103,12 +103,12 @@ save_regs:; .type save_regs, %function ...@@ -103,12 +103,12 @@ save_regs:; .type save_regs, %function
mrs x0, sp_el0 mrs x0, sp_el0
stp x28, x0, [sp, #GPREGS_X28_OFF] stp x28, x0, [sp, #GPREGS_X28_OFF]
mrs x0, spsr_el3 mrs x0, spsr_el3
str x0, [sp, #GPREGS_SPSR_OFF] str w0, [sp, #GPREGS_SPSR_OFF]
ret ret
restore_regs:; .type restore_regs, %function restore_regs:; .type restore_regs, %function
ldr x9, [sp, #GPREGS_SPSR_OFF] ldr w9, [sp, #GPREGS_SPSR_OFF]
msr spsr_el3, x9 msr spsr_el3, x9
ldp x28, x9, [sp, #GPREGS_X28_OFF] ldp x28, x9, [sp, #GPREGS_X28_OFF]
msr sp_el0, x9 msr sp_el0, x9
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment