1
2/*--------------------------------------------------------------------*/
3/*--- Structure written into the child process by launcher-aix5.c. ---*/
4/*---                                    launcher-aix5-bootblock.h ---*/
5/*--------------------------------------------------------------------*/
6
7/*
8   This file is part of Valgrind, a dynamic binary instrumentation
9   framework.
10
11   Copyright (C) 2006-2010 OpenWorks LLP
12      info@open-works.co.uk
13
14   This program is free software; you can redistribute it and/or
15   modify it under the terms of the GNU General Public License as
16   published by the Free Software Foundation; either version 2 of the
17   License, or (at your option) any later version.
18
19   This program is distributed in the hope that it will be useful, but
20   WITHOUT ANY WARRANTY; without even the implied warranty of
21   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22   General Public License for more details.
23
24   You should have received a copy of the GNU General Public License
25   along with this program; if not, write to the Free Software
26   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27   02111-1307, USA.
28
29   The GNU General Public License is contained in the file COPYING.
30
31   Neither the names of the U.S. Department of Energy nor the
32   University of California nor the names of its contributors may be
33   used to endorse or promote products derived from this software
34   without prior written permission.
35*/
36
37
38/* This is the structure written into the child process by the AIX5
39   launcher.  The tool's entry point (see bottom of
40   coregrind/m_main.c) must be aware of the layout as it will have to
41   read info from it at startup.  This struct is designed to work
42   equally well in 32- and 64-bit mode.  It must be placed at an
43   8-aligned address in the child. */
44
45#define N_BOOTBLOCK_INSNS    60  /* number of insns */
46#define N_BOOTBLOCK_ERRMSG   64  /* max bytes in the error message */
47#define N_BOOTBLOCK_TOOLFILE 256 /* max bytes in the tool file name */
48
49typedef
50
51   struct {
52      /* Adler32 checksum of the uncompressed data of the compressed
53	 page (the second part of which contains this struct. */
54      /*   0 */ UInt adler32;
55
56      /* The system call numbers for enough critical syscalls that the
57         tool can start both debug logging and also read the
58         /proc/../sysent file. */
59      /*   4 */ UInt __NR_getpid;
60      /*   8 */ UInt __NR_write;
61      /*  12 */ UInt __NR_exit;
62      /*  16 */ UInt __NR_open;
63      /*  20 */ UInt __NR_read;
64      /*  24 */ UInt __NR_close;
65      /*  28 */ UInt __off28;
66
67      /* The 37 integer registers for the client, as they should be at
68         startup.  On 32-bit targets the registers are stored in the
69         lower half of each quadword, which, since this is a bigendian
70         platform, is the higher-addressed 4 bytes. */
71      /* MUST BE 8-aligned */
72      /*  32 */ ULong iregs_pc_cr_lr_ctr_xer[37];
73
74      /* The instructions for the bootstrap loader. */
75      /* 328 */ UInt code[N_BOOTBLOCK_INSNS];
76
77      /* A zero-terminated error message to be used when the bootstrap
78         loader fails. */
79      /* 628 */ UChar errmsg[N_BOOTBLOCK_ERRMSG];
80
81      /* The name of the tool file, again zero-terminated. */
82      /* 692 */ UChar toolfile[N_BOOTBLOCK_TOOLFILE];
83
84      /* 1024 */
85   }
86   AIX5Bootblock;
87
88/*--------------------------------------------------------------------*/
89/*--- end                                launcher-aix5-bootblock.h ---*/
90/*--------------------------------------------------------------------*/
91