summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-04-03 18:28:03 +0000
committerjake <jake@FreeBSD.org>2003-04-03 18:28:03 +0000
commitd37e1467193889798aa297d78b20582b354c55d7 (patch)
treefc04072b22327e50f2c8c111783edbdd9eb5f118 /sys
parentffcfcc8152a16ce4eaf5f537dca60fae1e775fbc (diff)
downloadFreeBSD-src-d37e1467193889798aa297d78b20582b354c55d7.zip
FreeBSD-src-d37e1467193889798aa297d78b20582b354c55d7.tar.gz
- Add space for kernel floating point registers to the pcb. These will be
used to support block copy and zero operations in the kernel which use the floating point registers. - While I'm changing the size, improve the layout of struct pcb, sort by size, then alphabetical etc. - Add some assertions to validate assumptions made about how the pcb is allocated.
Diffstat (limited to 'sys')
-rw-r--r--sys/sparc64/include/pcb.h14
-rw-r--r--sys/sparc64/sparc64/genassym.c9
-rw-r--r--sys/sparc64/sparc64/machdep.c5
3 files changed, 18 insertions, 10 deletions
diff --git a/sys/sparc64/include/pcb.h b/sys/sparc64/include/pcb.h
index 93615ba..38578d2 100644
--- a/sys/sparc64/include/pcb.h
+++ b/sys/sparc64/include/pcb.h
@@ -37,13 +37,15 @@
/* NOTE: pcb_ufp must be aligned on a 64 byte boundary. */
struct pcb {
- uint32_t pcb_ufp[64];
- u_long pcb_sp;
- u_long pcb_pc;
- u_long pcb_flags;
- u_long pcb_nsaved;
- u_long pcb_rwsp[MAXWIN];
struct rwindow pcb_rw[MAXWIN];
+ uint32_t pcb_kfp[64];
+ uint32_t pcb_ufp[64];
+ uint64_t pcb_rwsp[MAXWIN];
+ uint64_t pcb_flags;
+ uint64_t pcb_nsaved;
+ uint64_t pcb_pc;
+ uint64_t pcb_sp;
+ uint64_t pcb_pad[4];
} __aligned(64);
#ifdef _KERNEL
diff --git a/sys/sparc64/sparc64/genassym.c b/sys/sparc64/sparc64/genassym.c
index e014d97..704f932 100644
--- a/sys/sparc64/sparc64/genassym.c
+++ b/sys/sparc64/sparc64/genassym.c
@@ -243,13 +243,14 @@ ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
ASSYM(TD_PROC, offsetof(struct thread, td_proc));
ASSYM(PCB_SIZEOF, sizeof(struct pcb));
+ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
+ASSYM(PCB_KFP, offsetof(struct pcb, pcb_kfp));
ASSYM(PCB_UFP, offsetof(struct pcb, pcb_ufp));
-ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
-ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
+ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved));
-ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp));
-ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw));
+ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc));
+ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp));
ASSYM(PCB_FEF, PCB_FEF);
ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap));
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c
index 9030523..5d01e09 100644
--- a/sys/sparc64/sparc64/machdep.c
+++ b/sys/sparc64/sparc64/machdep.c
@@ -147,6 +147,11 @@ CTASSERT(sizeof(struct reg) == 256);
CTASSERT(sizeof(struct fpreg) == 272);
CTASSERT(sizeof(struct __mcontext) == 512);
+CTASSERT((sizeof(struct pcb) & (64 - 1)) == 0);
+CTASSERT((offsetof(struct pcb, pcb_kfp) & (64 - 1)) == 0);
+CTASSERT((offsetof(struct pcb, pcb_ufp) & (64 - 1)) == 0);
+CTASSERT(sizeof(struct pcb) <= ((KSTACK_PAGES * PAGE_SIZE) / 8));
+
CTASSERT(sizeof(struct pcpu) <= ((PCPU_PAGES * PAGE_SIZE) / 2));
static void
OpenPOWER on IntegriCloud