libvex_guest_ppc64.h revision efa834abaded25c8aff2f3923e476ef7cc1d0396
1ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
2da751ca9665bcdeca56d2eec5b629a0953c07662Jens Axboe/*---------------------------------------------------------------*/
3da751ca9665bcdeca56d2eec5b629a0953c07662Jens Axboe/*--- begin                              libvex_guest_ppc64.h ---*/
4da751ca9665bcdeca56d2eec5b629a0953c07662Jens Axboe/*---------------------------------------------------------------*/
5da751ca9665bcdeca56d2eec5b629a0953c07662Jens Axboe
6ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe/*
7ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   This file is part of Valgrind, a dynamic binary instrumentation
8ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   framework.
9ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
10ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   Copyright (C) 2004-2012 OpenWorks LLP
11ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      info@open-works.net
12ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
13ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   This program is free software; you can redistribute it and/or
14ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   modify it under the terms of the GNU General Public License as
155fdd124a3b811993542825847f207587d5f4661eJens Axboe   published by the Free Software Foundation; either version 2 of the
16ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   License, or (at your option) any later version.
17ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
18ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   This program is distributed in the hope that it will be useful, but
19b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   WITHOUT ANY WARRANTY; without even the implied warranty of
20b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   General Public License for more details.
229cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
239cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe   You should have received a copy of the GNU General Public License
24b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   along with this program; if not, write to the Free Software
25b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   02110-1301, USA.
27ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
28ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   The GNU General Public License is contained in the file COPYING.
29ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
30b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   Neither the names of the U.S. Department of Energy nor the
31ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   University of California nor the names of its contributors may be
32ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe   used to endorse or promote products derived from this software
337a6499dada619928267d26b4629b0c8623dc423aJens Axboe   without prior written permission.
347a6499dada619928267d26b4629b0c8623dc423aJens Axboe*/
357a6499dada619928267d26b4629b0c8623dc423aJens Axboe
36b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe#ifndef __LIBVEX_PUB_GUEST_PPC64_H
37b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe#define __LIBVEX_PUB_GUEST_PPC64_H
38e1161c325f7866bae879e686d1c673ca32ab09aeJens Axboe
397a6499dada619928267d26b4629b0c8623dc423aJens Axboe#include "libvex_basictypes.h"
40ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
417a6499dada619928267d26b4629b0c8623dc423aJens Axboe/*
42ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe    volatile ==  caller-saved (not preserved across function calls)
43ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboenon-volatile ==  callee-saved (preserved across function calls)
44ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
45ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboer0        Volatile register used in function prologs
46ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboer1        Stack frame pointer
47e01547d2b8bf79c3abe14e03c72398cf8998eb1eJens Axboer2        TOC pointer
48e01547d2b8bf79c3abe14e03c72398cf8998eb1eJens Axboer3        Volatile parameter and return value register
49e01547d2b8bf79c3abe14e03c72398cf8998eb1eJens Axboer4-r10    Volatile registers used for function parameters
50e01547d2b8bf79c3abe14e03c72398cf8998eb1eJens Axboer11       Volatile register used in calls by pointer and as an
51e1161c325f7866bae879e686d1c673ca32ab09aeJens Axboe          environment pointer for languages which require one
52ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboer12       Volatile register used for exception handling and glink code
53ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboer13       Reserved for use as system thread ID
54ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboer14-r31   Nonvolatile registers used for local variables
559cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
569cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboef0        Volatile scratch register
579cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboef1-f4     Volatile floating point parameter and return value registers
589cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboef5-f13    Volatile floating point parameter registers
59ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboef14-f31   Nonvolatile registers
609cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
619cce02e89e01984a5bf58e730fb9311dc5273554Jens AxboeLR        Link register (volatile)
62ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens AxboeCTR       Loop counter register (volatile)
639cce02e89e01984a5bf58e730fb9311dc5273554Jens AxboeXER       Fixed point exception register (volatile)
647a6499dada619928267d26b4629b0c8623dc423aJens AxboeFPSCR     Floating point status and control register (volatile)
659cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
66f657a2fbbb0deaf455edc478d73b664929bcb766Jens AxboeCR0-CR1   Volatile condition code register fields
679cce02e89e01984a5bf58e730fb9311dc5273554Jens AxboeCR2-CR4   Nonvolatile condition code register fields
689cce02e89e01984a5bf58e730fb9311dc5273554Jens AxboeCR5-CR7   Volatile condition code register fields
699cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
709cce02e89e01984a5bf58e730fb9311dc5273554Jens AxboeOn processors with the VMX feature.
719cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
729cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboev0-v1     Volatile scratch registers
739cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboev2-v13    Volatile vector parameters registers
749cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboev14-v19   Volatile scratch registers
759cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboev20-v31   Non-volatile registers
769cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboevrsave    Non-volatile 32-bit register
77f657a2fbbb0deaf455edc478d73b664929bcb766Jens Axboe*/
789cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
799cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
809cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe/*---------------------------------------------------------------*/
819cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe/*--- Vex's representation of the PPC64 CPU state             ---*/
829cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe/*---------------------------------------------------------------*/
839cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
849cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe#define VEX_GUEST_PPC64_REDIR_STACK_SIZE (16/*entries*/ * 2/*words per entry*/)
859cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
869cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboetypedef
879cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe   struct {
889cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe     /* Event check fail addr, counter, and padding to make GPR0 16
899cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe        aligned. */
909cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*   0 */ ULong  host_EvC_FAILADDR;
919cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*   8 */ UInt   host_EvC_COUNTER;
929cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  12 */ UInt   pad0;
939cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* Add 16 to all of the offsets below .. */
949cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* General Purpose Registers */
959cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*   0 */ ULong guest_GPR0;
969cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*   8 */ ULong guest_GPR1;
979cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  16 */ ULong guest_GPR2;
989cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  24 */ ULong guest_GPR3;
999cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  32 */ ULong guest_GPR4;
1009cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  40 */ ULong guest_GPR5;
1019cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  48 */ ULong guest_GPR6;
1029cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  56 */ ULong guest_GPR7;
1039cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  64 */ ULong guest_GPR8;
1049cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  72 */ ULong guest_GPR9;
1059cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  80 */ ULong guest_GPR10;
1069cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  88 */ ULong guest_GPR11;
1079cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  96 */ ULong guest_GPR12;
1089cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 104 */ ULong guest_GPR13;
1099cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 112 */ ULong guest_GPR14;
1109cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 120 */ ULong guest_GPR15;
1119cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 128 */ ULong guest_GPR16;
1129cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 136 */ ULong guest_GPR17;
1139cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 144 */ ULong guest_GPR18;
1149cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 152 */ ULong guest_GPR19;
1159cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 160 */ ULong guest_GPR20;
1169cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 168 */ ULong guest_GPR21;
1179cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 176 */ ULong guest_GPR22;
1189cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 184 */ ULong guest_GPR23;
1199cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 192 */ ULong guest_GPR24;
1209cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 200 */ ULong guest_GPR25;
1219cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 208 */ ULong guest_GPR26;
1229cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 216 */ ULong guest_GPR27;
1239cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 224 */ ULong guest_GPR28;
1249cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 232 */ ULong guest_GPR29;
1259cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 240 */ ULong guest_GPR30;
1269cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 248 */ ULong guest_GPR31;
1279cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
1289cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // Vector Registers, Floating Point Registers, and VSX Registers
1299cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // With ISA 2.06, the "Vector-Scalar Floating-point" category
1309cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // provides facilities to support vector and scalar binary floating-
1319cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // point operations.  A unified register file is an integral part
1329cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // of this new facility, combining floating point and vector registers
1339cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // using a 64x128-bit vector.  These are referred to as VSR[0..63].
1349cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // The floating point registers are now mapped into double word element 0
135f657a2fbbb0deaf455edc478d73b664929bcb766Jens Axboe      // of VSR[0..31]. The 32x128-bit vector registers defined by the "Vector
1369cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // Facility [Category: Vector]" are now mapped to VSR[32..63].
1379cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
1389cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // IMPORTANT: the user of libvex must place the guest state so as
1399cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // to ensure that guest_VSR{0..63}, and any shadows thereof, are
1409cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      // 16-aligned.
1419cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
1429cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  256 */ U128 guest_VSR0;
1439cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  272 */ U128 guest_VSR1;
1449cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  288 */ U128 guest_VSR2;
1459cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  304 */ U128 guest_VSR3;
1469cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  320 */ U128 guest_VSR4;
1479cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  336 */ U128 guest_VSR5;
1489cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  352 */ U128 guest_VSR6;
1499cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  368 */ U128 guest_VSR7;
1509cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  384 */ U128 guest_VSR8;
1519cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  400 */ U128 guest_VSR9;
1529cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  416 */ U128 guest_VSR10;
1539cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  432 */ U128 guest_VSR11;
1549cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  448 */ U128 guest_VSR12;
1559cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  464 */ U128 guest_VSR13;
1569cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  480 */ U128 guest_VSR14;
1579cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  496 */ U128 guest_VSR15;
1589cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  512 */ U128 guest_VSR16;
1599cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  528 */ U128 guest_VSR17;
1609cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  544 */ U128 guest_VSR18;
1619cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  560 */ U128 guest_VSR19;
1629cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  576 */ U128 guest_VSR20;
1639cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  592 */ U128 guest_VSR21;
1649cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  608 */ U128 guest_VSR22;
1659cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  624 */ U128 guest_VSR23;
1669cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  640 */ U128 guest_VSR24;
1679cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  656 */ U128 guest_VSR25;
168ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /*  672 */ U128 guest_VSR26;
1699cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  688 */ U128 guest_VSR27;
1709cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  704 */ U128 guest_VSR28;
1719cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  720 */ U128 guest_VSR29;
1729cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  736 */ U128 guest_VSR30;
1739cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  752 */ U128 guest_VSR31;
1749cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  768 */ U128 guest_VSR32;
1759cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  784 */ U128 guest_VSR33;
1769cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  800 */ U128 guest_VSR34;
1779cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  816 */ U128 guest_VSR35;
1789cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  832 */ U128 guest_VSR36;
1799cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  848 */ U128 guest_VSR37;
1809cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  864 */ U128 guest_VSR38;
1819cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  880 */ U128 guest_VSR39;
1829cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  896 */ U128 guest_VSR40;
1839cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  912 */ U128 guest_VSR41;
1849cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  928 */ U128 guest_VSR42;
1859cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  944 */ U128 guest_VSR43;
1869cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  960 */ U128 guest_VSR44;
1879cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  976 */ U128 guest_VSR45;
1889cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /*  992 */ U128 guest_VSR46;
1899cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1008 */ U128 guest_VSR47;
1909cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1024 */ U128 guest_VSR48;
1919cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1040 */ U128 guest_VSR49;
1929cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1056 */ U128 guest_VSR50;
1939cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1072 */ U128 guest_VSR51;
1949cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1088 */ U128 guest_VSR52;
1959cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1104 */ U128 guest_VSR53;
1969cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1120 */ U128 guest_VSR54;
1979cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1136 */ U128 guest_VSR55;
1989cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1152 */ U128 guest_VSR56;
1999cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1168 */ U128 guest_VSR57;
2009cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1184 */ U128 guest_VSR58;
2019cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1200 */ U128 guest_VSR59;
2029cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1216 */ U128 guest_VSR60;
2039cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1232 */ U128 guest_VSR61;
2049cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1248 */ U128 guest_VSR62;
2059cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1264 */ U128 guest_VSR63;
2069cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
2079cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1280 */ ULong guest_CIA;    // IP (no arch visible register)
2089cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1288 */ ULong guest_LR;     // Link Register
2099cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1296 */ ULong guest_CTR;    // Count Register
2109cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
2119cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* XER pieces */
2129cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1304 */ UChar guest_XER_SO; /* in lsb */
2139cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1305 */ UChar guest_XER_OV; /* in lsb */
2149cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1306 */ UChar guest_XER_CA; /* in lsb */
2159cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1307 */ UChar guest_XER_BC; /* all bits */
2169cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe
2179cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* CR pieces */
2189cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1308 */ UChar guest_CR0_321; /* in [3:1] */
2199cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1309 */ UChar guest_CR0_0;   /* in lsb */
2209cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1310 */ UChar guest_CR1_321; /* in [3:1] */
2219cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1311 */ UChar guest_CR1_0;   /* in lsb */
2229cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1312 */ UChar guest_CR2_321; /* in [3:1] */
2239cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1313 */ UChar guest_CR2_0;   /* in lsb */
224d4f12dd05cfb2e8e7a72604cd870e10f2394914eJens Axboe      /* 1314 */ UChar guest_CR3_321; /* in [3:1] */
2259cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1315 */ UChar guest_CR3_0;   /* in lsb */
2269cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1316 */ UChar guest_CR4_321; /* in [3:1] */
2279cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1317 */ UChar guest_CR4_0;   /* in lsb */
2289cce02e89e01984a5bf58e730fb9311dc5273554Jens Axboe      /* 1318 */ UChar guest_CR5_321; /* in [3:1] */
229d4f12dd05cfb2e8e7a72604cd870e10f2394914eJens Axboe      /* 1319 */ UChar guest_CR5_0;   /* in lsb */
2307a6499dada619928267d26b4629b0c8623dc423aJens Axboe      /* 1320 */ UChar guest_CR6_321; /* in [3:1] */
231ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1321 */ UChar guest_CR6_0;   /* in lsb */
232cec6b55da1c282b5b91ad346c7804171fccf151eJens Axboe      /* 1322 */ UChar guest_CR7_321; /* in [3:1] */
23322819ec237297fc39435ed566bee01a4225bfb39Jens Axboe      /* 1323 */ UChar guest_CR7_0;   /* in lsb */
234cec6b55da1c282b5b91ad346c7804171fccf151eJens Axboe
235cec6b55da1c282b5b91ad346c7804171fccf151eJens Axboe      /* FP Status and  Control Register fields. Only rounding mode fields
23636167d82e5f49dee91c6d2cd426068edee90e36fJens Axboe	 are supported. */
237ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1324 */ UChar guest_FPROUND; // Binary Floating Point Rounding Mode
238ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1325 */ UChar guest_DFPROUND; // Decimal Floating Point Rounding Mode
239ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1326 */ UChar pad1;
240ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1327 */ UChar pad2;
24136167d82e5f49dee91c6d2cd426068edee90e36fJens Axboe
242e1161c325f7866bae879e686d1c673ca32ab09aeJens Axboe      /* Vector Save/Restore Register */
243ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1328 */ UInt guest_VRSAVE;
24436167d82e5f49dee91c6d2cd426068edee90e36fJens Axboe
245ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* Vector Status and Control Register */
246ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1332 */ UInt guest_VSCR;
247b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
248ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* Emulation notes */
249b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe      /* 1336 */ UInt guest_EMNOTE;
250ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe
251b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe      /* gcc adds 4 bytes padding here: pre-empt it. */
252b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe      /* 1340 */ UInt  padding;
253b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
254b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe      /* For icbi: record start and length of area to invalidate */
255ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1344 */ ULong guest_TISTART;
256ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1352 */ ULong guest_TILEN;
257b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
258b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe      /* Used to record the unredirected guest address at the start of
259b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe         a translation whose start has been redirected.  By reading
260ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe         this pseudo-register shortly afterwards, the translation can
261ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe         find out what the corresponding no-redirection address was.
262ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe         Note, this is only set for wrap-style redirects, not for
263ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe         replace-style ones. */
264ed92ac0ce9ce1cc64697272d307d4fa7d18ed64cJens Axboe      /* 1360 */ ULong guest_NRADDR;
265b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe      /* 1368 */ ULong guest_NRADDR_GPR2;
2665fdd124a3b811993542825847f207587d5f4661eJens Axboe
267b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe     /* A grows-upwards stack for hidden saves/restores of LR and R2
268b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe        needed for function interception and wrapping on ppc64-linux.
2695fdd124a3b811993542825847f207587d5f4661eJens Axboe        A horrible hack.  REDIR_SP points to the highest live entry,
270b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe        and so starts at -1. */
2715fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* 1376 */ ULong guest_REDIR_SP;
2726d86144dd10b05e8b82e9b895c35dd778e5e71abJens Axboe      /* 1384 */ ULong guest_REDIR_STACK[VEX_GUEST_PPC64_REDIR_STACK_SIZE];
2735fdd124a3b811993542825847f207587d5f4661eJens Axboe
2745fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* Needed for AIX: CIA at the last SC insn.  Used when backing up
2755fdd124a3b811993542825847f207587d5f4661eJens Axboe         to restart a syscall that has been interrupted by a signal. */
2765fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* 1640 */ ULong guest_IP_AT_SYSCALL;
2775fdd124a3b811993542825847f207587d5f4661eJens Axboe
278b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe      /* SPRG3, which AIUI is readonly in user space.  Needed for
279b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe         threading on AIX. */
2805fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* 1648 */ ULong guest_SPRG3_RO;
2815fdd124a3b811993542825847f207587d5f4661eJens Axboe
2825fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* offsets in comments are wrong ..*/
2835fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* Padding to make it have an 16-aligned size */
2845fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* 1656 */ ULong padding2;
2855fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* 16XX */ ULong padding3;
2865fdd124a3b811993542825847f207587d5f4661eJens Axboe      /* 16XX */ ULong padding4;
287e1161c325f7866bae879e686d1c673ca32ab09aeJens Axboe   }
2885fdd124a3b811993542825847f207587d5f4661eJens Axboe   VexGuestPPC64State;
2895fdd124a3b811993542825847f207587d5f4661eJens Axboe
2905fdd124a3b811993542825847f207587d5f4661eJens Axboe
2915fdd124a3b811993542825847f207587d5f4661eJens Axboe/*---------------------------------------------------------------*/
2920c09442b26216aed16f758712f744a2c54726cdbJens Axboe/*--- Utility functions for PPC64 guest stuff.                ---*/
2930c09442b26216aed16f758712f744a2c54726cdbJens Axboe/*---------------------------------------------------------------*/
2940c09442b26216aed16f758712f744a2c54726cdbJens Axboe
2950c09442b26216aed16f758712f744a2c54726cdbJens Axboe/* ALL THE FOLLOWING ARE VISIBLE TO LIBRARY CLIENT */
2960c09442b26216aed16f758712f744a2c54726cdbJens Axboe
2970c09442b26216aed16f758712f744a2c54726cdbJens Axboe/* Initialise all guest PPC64 state. */
298b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboeextern
299b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboevoid LibVEX_GuestPPC64_initialise ( /*OUT*/VexGuestPPC64State* vex_state );
300b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
301b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
302b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe/* Write the given native %CR value to the supplied VexGuestPPC64State
303b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   structure.  Note, %CR is 32-bits even for ppc64. */
304b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboeextern
3055fdd124a3b811993542825847f207587d5f4661eJens Axboevoid LibVEX_GuestPPC64_put_CR ( UInt cr_native,
306b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe                                /*OUT*/VexGuestPPC64State* vex_state );
307b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
308b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe/* Extract from the supplied VexGuestPPC64State structure the
309b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   corresponding native %CR value.  Note, %CR is 32-bits even for
310b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   ppc64. */
311b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboeextern
312b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens AxboeUInt LibVEX_GuestPPC64_get_CR ( /*IN*/const VexGuestPPC64State* vex_state );
313b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
314b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
315b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe/* Write the given native %XER value to the supplied
316b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   VexGuestPPC64State structure.  Note, %XER is 32-bits even for
317b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   ppc64. */
318b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboeextern
319b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboevoid LibVEX_GuestPPC64_put_XER ( UInt xer_native,
320b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe                                 /*OUT*/VexGuestPPC64State* vex_state );
321b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
322b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe/* Extract from the supplied VexGuestPPC64State structure the
323b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   corresponding native %XER value.  Note, %CR is 32-bits even for
324b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe   ppc64. */
325b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboeextern
326b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens AxboeUInt LibVEX_GuestPPC64_get_XER ( /*IN*/const VexGuestPPC64State* vex_state );
327b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
328b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe#endif /* ndef __LIBVEX_PUB_GUEST_PPC64_H */
329b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
330b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe
331b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe/*---------------------------------------------------------------*/
332b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe/*---                                    libvex_guest_ppc64.h ---*/
3335fdd124a3b811993542825847f207587d5f4661eJens Axboe/*---------------------------------------------------------------*/
334b5af82930ccfd7dda6a1b11794efb452eb76d8dcJens Axboe