Skip to content

Commit

Permalink
include: sbi: Don't pack struct sbi_platform and sbi_platform_operations
Browse files Browse the repository at this point in the history
We don't need to pack struct sbi_platform and sbi_platform_operations
because GCC ensures member offsets match member data type irrespective
to the target system (RV32 or RV64). This also allows GCC to generate
more optimized instruction sequence when accessing members of struct
sbi_platform and struct sbi_platform_operations.

Reported-by: Paul Campbell <[email protected]>
Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
  • Loading branch information
avpatel committed Jan 15, 2021
1 parent 386eba2 commit 1bbf361
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/sbi/sbi_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct sbi_platform_operations {
const struct sbi_trap_regs *regs,
unsigned long *out_value,
struct sbi_trap_info *out_trap);
} __packed;
};

/** Platform default per-HART stack size for exception/interrupt handling */
#define SBI_PLATFORM_DEFAULT_HART_STACK_SIZE 8192
Expand Down Expand Up @@ -199,7 +199,7 @@ struct sbi_platform {
* 2. HART id < SBI_HARTMASK_MAX_BITS
*/
const u32 *hart_index2id;
} __packed;
};

/** Get pointer to sbi_platform for sbi_scratch pointer */
#define sbi_platform_ptr(__s) \
Expand Down

0 comments on commit 1bbf361

Please sign in to comment.