/*-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 _STANDALONE43struct pcb {44register_t pcb_context[20]; /* non-volatile r12-r31 */45register_t pcb_cr; /* Condition register */46register_t pcb_sp; /* stack pointer */47register_t pcb_toc; /* toc pointer */48register_t pcb_lr; /* link register */49register_t pcb_dscr; /* dscr value */50register_t pcb_fscr;51register_t pcb_tar;52struct pmap *pcb_pm; /* pmap of our vmspace */53jmp_buf *pcb_onfault; /* For use during54copyin/copyout */55int pcb_flags;56#define PCB_FPU 0x1 /* Process uses FPU */57#define PCB_FPREGS 0x2 /* Process had FPU registers initialized */58#define PCB_VEC 0x4 /* Process uses Altivec */59#define PCB_VSX 0x8 /* Process had VSX initialized */60#define PCB_CDSCR 0x10 /* Process had Custom DSCR initialized */61#define PCB_HTM 0x20 /* Process had HTM initialized */62#define PCB_CFSCR 0x40 /* Process had FSCR updated */63#define PCB_KERN_FPU 0x80 /* Kernel is using FPU/Vector unit */64#define PCB_KERN_FPU_NOSAVE 0x100 /* FPU/Vec state not saved for kernel use */65#define PCB_VECREGS 0x200 /* Process had Altivec registers initialized */66struct fpu {67union {68uint32_t vsr[4];69double fpr;70} fpr[32];71double fpscr; /* FPSCR stored as double for easier access */72} pcb_fpu; /* Floating point processor */73unsigned int pcb_fpcpu; /* which CPU had our FPU74stuff. */75struct vec {76uint32_t vr[32][4];77uint32_t spare[2];78uint32_t vrsave;79uint32_t vscr; /* aligned at vector element 3 */80} pcb_vec __aligned(16); /* Vector processor */81unsigned int pcb_veccpu; /* which CPU had our vector82stuff. */83struct htm {84uint64_t tfhar;85uint64_t texasr;86uint64_t tfiar;87} pcb_htm;8889struct ebb {90uint64_t ebbhr;91uint64_t ebbrr;92uint64_t bescr;93} pcb_ebb;9495struct lmon {96uint64_t lmrr;97uint64_t lmser;98} pcb_lm;99100union {101struct {102vm_offset_t usr_segm; /* Base address */103register_t usr_vsid; /* USER_SR segment */104} aim;105struct {106register_t dbcr0;107} booke;108} pcb_cpu;109vm_offset_t pcb_lastill; /* Last illegal instruction */110};111#endif112113#ifdef _KERNEL114115struct trapframe;116117#ifndef curpcb118extern struct pcb *curpcb;119#endif120121extern struct pmap *curpm;122extern struct proc *fpuproc;123124void makectx(struct trapframe *, struct pcb *);125void savectx(struct pcb *) __returns_twice;126127#endif128#endif /* _MACHINE_PCB_H_ */129130131