git: fb421e96c030 - main - Make arm64 pcb padding explicit
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 24 Apr 2023 11:34:10 UTC
The branch main has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=fb421e96c03087ef9e02e64232763906b6da88ae
commit fb421e96c03087ef9e02e64232763906b6da88ae
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2023-04-24 09:57:06 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2023-04-24 11:33:50 +0000
Make arm64 pcb padding explicit
There is padding between some fields. Mark those I have found so they
can be reused later if needed.
Sponsored by: Arm Ltd
---
sys/arm64/arm64/machdep.c | 6 ++++++
sys/arm64/include/pcb.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index d9ea06952c54..4aac339b1a1b 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -104,6 +104,12 @@ __FBSDID("$FreeBSD$");
#include <dev/smbios/smbios.h>
+_Static_assert(sizeof(struct pcb) == 1216, "struct pcb is incorrect size");
+_Static_assert(offsetof(struct pcb, pcb_fpusaved) == 136,
+ "pcb_fpusaved changed offset");
+_Static_assert(offsetof(struct pcb, pcb_fpustate) == 160,
+ "pcb_fpustate changed offset");
+
enum arm64_bus arm64_bus_method = ARM64_BUS_NONE;
/*
diff --git a/sys/arm64/include/pcb.h b/sys/arm64/include/pcb.h
index 8ffe6f2d483e..35f04787c781 100644
--- a/sys/arm64/include/pcb.h
+++ b/sys/arm64/include/pcb.h
@@ -57,6 +57,7 @@ struct pcb {
u_int pcb_flags;
#define PCB_SINGLE_STEP_SHIFT 0
#define PCB_SINGLE_STEP (1 << PCB_SINGLE_STEP_SHIFT)
+ uint32_t pcb_pad1;
struct vfpstate *pcb_fpusaved;
int pcb_fpflags;
@@ -66,6 +67,7 @@ struct pcb {
/* The bits passed to userspace in get_fpcontext */
#define PCB_FP_USERMASK (PCB_FP_STARTED)
u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */
+ uint64_t pcb_pad2;
/*
* The userspace VFP state. The pcb_fpusaved pointer will point to