/*-1* SPDX-License-Identifier: BSD-4-Clause2*3* Copyright (C) 1995, 1996 Wolfgang Solfrank.4* Copyright (C) 1995, 1996 TooLs GmbH.5* All rights reserved.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted provided that the following conditions9* are met:10* 1. Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15* 3. All advertising materials mentioning features or use of this software16* must display the following acknowledgement:17* This product includes software developed by TooLs GmbH.18* 4. The name of TooLs GmbH may not be used to endorse or promote products19* derived from this software without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR22* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES23* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.24* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,25* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,26* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;27* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,28* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR29* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF30* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31*32* $NetBSD: pcb.h,v 1.4 2000/06/04 11:57:17 tsubai Exp $33*/3435#ifndef _MACHINE_PCB_H_36#define _MACHINE_PCB_H_3738#include <sys/endian.h>3940#include <machine/setjmp.h>4142#ifndef _STANDALONE43/*44* struct pcb is known to and used by kernel debuggers. Its layout must be kept45* stable. When adding extra fields that are accessed by kernel debuggers,46* debuggers should be backward compatible by using osreldate.47*/48struct pcb {49register_t pcb_context[20]; /* non-volatile r12-r31 */50register_t pcb_cr; /* Condition register */51register_t pcb_sp; /* stack pointer */52register_t pcb_toc; /* toc pointer */53register_t pcb_lr; /* link register */54register_t pcb_dscr; /* dscr value */55register_t pcb_fscr;56register_t pcb_tar;57struct pmap *pcb_pm; /* pmap of our vmspace */58jmp_buf *pcb_onfault; /* For use during59copyin/copyout */60int pcb_flags;61#define PCB_FPU 0x1 /* Process uses FPU */62#define PCB_FPREGS 0x2 /* Process had FPU registers initialized */63#define PCB_VEC 0x4 /* Process uses Altivec */64#define PCB_VSX 0x8 /* Process had VSX initialized */65#define PCB_CDSCR 0x10 /* Process had Custom DSCR initialized */66#define PCB_HTM 0x20 /* Process had HTM initialized */67#define PCB_CFSCR 0x40 /* Process had FSCR updated */68#define PCB_KERN_FPU 0x80 /* Kernel is using FPU/Vector unit */69#define PCB_KERN_FPU_NOSAVE 0x100 /* FPU/Vec state not saved for kernel use */70#define PCB_VECREGS 0x200 /* Process had Altivec registers initialized */71struct fpu {72union {73uint32_t vsr[4];74double fpr;75} fpr[32];76double fpscr; /* FPSCR stored as double for easier access */77} pcb_fpu; /* Floating point processor */78unsigned int pcb_fpcpu; /* which CPU had our FPU79stuff. */80struct vec {81uint32_t vr[32][4];82uint32_t spare[2];83uint32_t vrsave;84uint32_t vscr; /* aligned at vector element 3 */85} pcb_vec __aligned(16); /* Vector processor */86unsigned int pcb_veccpu; /* which CPU had our vector87stuff. */88struct htm {89uint64_t tfhar;90uint64_t texasr;91uint64_t tfiar;92} pcb_htm;9394struct ebb {95uint64_t ebbhr;96uint64_t ebbrr;97uint64_t bescr;98} pcb_ebb;99100struct lmon {101uint64_t lmrr;102uint64_t lmser;103} pcb_lm;104105union {106struct {107vm_offset_t usr_segm; /* Base address */108register_t usr_vsid; /* USER_SR segment */109} aim;110struct {111register_t dbcr0;112} booke;113} pcb_cpu;114vm_offset_t pcb_lastill; /* Last illegal instruction */115};116#endif117118#ifdef _KERNEL119120struct trapframe;121122#ifndef curpcb123extern struct pcb *curpcb;124#endif125126extern struct pmap *curpm;127extern struct proc *fpuproc;128129void makectx(struct trapframe *, struct pcb *);130void savectx(struct pcb *) __returns_twice;131132#endif133#endif /* _MACHINE_PCB_H_ */134135136