- 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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user