Correct padding length for RISC-V PCPU data.

There was an additional 7 bytes of compiler-inserted padding at the
end of the structure visible via 'ptype /o' in gdb.

Reviewed by:	mhorne
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25867
This commit is contained in:
John Baldwin 2020-08-12 18:45:36 +00:00
parent d5c62a6f03
commit 90699f2a76
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364176
2 changed files with 4 additions and 1 deletions

View file

@ -48,7 +48,7 @@
struct pmap *pc_curpmap; /* Currently active pmap */ \
uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \
uint32_t pc_hart; /* Hart ID */ \
char __pad[49]
char __pad[56] /* Pad to factor of PAGE_SIZE */
#ifdef _KERNEL

View file

@ -46,6 +46,9 @@
* be a multiple of the size of struct pcpu.
*/
_Static_assert(PAGE_SIZE % sizeof(struct pcpu) == 0, "fix pcpu size");
_Static_assert(offsetof(struct pcpu, __pad) +
sizeof(((struct pcpu *)0)->__pad) == sizeof(struct pcpu),
"fix pcpu padding");
extern struct pcpu __pcpu[];