111854Sbrandon.potter@amd.com/*
211854Sbrandon.potter@amd.com * Copyright (c) 2016 Advanced Micro Devices, Inc.
311854Sbrandon.potter@amd.com * All rights reserved.
411854Sbrandon.potter@amd.com *
511854Sbrandon.potter@amd.com * For use for simulation and test purposes only
611854Sbrandon.potter@amd.com *
711854Sbrandon.potter@amd.com * Redistribution and use in source and binary forms, with or without
811854Sbrandon.potter@amd.com * modification, are permitted provided that the following conditions are met:
911854Sbrandon.potter@amd.com *
1011854Sbrandon.potter@amd.com * 1. Redistributions of source code must retain the above copyright notice,
1111854Sbrandon.potter@amd.com * this list of conditions and the following disclaimer.
1211854Sbrandon.potter@amd.com *
1311854Sbrandon.potter@amd.com * 2. Redistributions in binary form must reproduce the above copyright notice,
1411854Sbrandon.potter@amd.com * this list of conditions and the following disclaimer in the documentation
1511854Sbrandon.potter@amd.com * and/or other materials provided with the distribution.
1611854Sbrandon.potter@amd.com *
1711854Sbrandon.potter@amd.com * 3. Neither the name of the copyright holder nor the names of its
1811854Sbrandon.potter@amd.com * contributors may be used to endorse or promote products derived from this
1911854Sbrandon.potter@amd.com * software without specific prior written permission.
2011854Sbrandon.potter@amd.com *
2111854Sbrandon.potter@amd.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2211854Sbrandon.potter@amd.com * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2311854Sbrandon.potter@amd.com * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2411854Sbrandon.potter@amd.com * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
2511854Sbrandon.potter@amd.com * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2611854Sbrandon.potter@amd.com * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2711854Sbrandon.potter@amd.com * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2811854Sbrandon.potter@amd.com * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2911854Sbrandon.potter@amd.com * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3011854Sbrandon.potter@amd.com * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3111854Sbrandon.potter@amd.com * POSSIBILITY OF SUCH DAMAGE.
3211854Sbrandon.potter@amd.com *
3312697Santhony.gutierrez@amd.com * Authors: Brandon Potter
3411854Sbrandon.potter@amd.com */
3511854Sbrandon.potter@amd.com
3611854Sbrandon.potter@amd.com#ifndef __AUX_VECTOR_HH__
3711854Sbrandon.potter@amd.com#define __AUX_VECTOR_HH__
3811854Sbrandon.potter@amd.com
3911854Sbrandon.potter@amd.comtemplate<class IntType>
4013028Sbrandon.potter@amd.comclass AuxVector
4111854Sbrandon.potter@amd.com{
4213028Sbrandon.potter@amd.com  public:
4313028Sbrandon.potter@amd.com    AuxVector() = default;
4413894Sgabeblack@google.com    AuxVector(IntType _type, IntType _val) : type(_type), val(_val) {}
4511854Sbrandon.potter@amd.com
4613894Sgabeblack@google.com    IntType type = 0;
4713894Sgabeblack@google.com    IntType val = 0;
4813894Sgabeblack@google.com};
4911854Sbrandon.potter@amd.com
5013894Sgabeblack@google.comtemplate<class IntType>
5113894Sgabeblack@google.cominline AuxVector<IntType>
5213894Sgabeblack@google.comswap_byte(AuxVector<IntType> av)
5313894Sgabeblack@google.com{
5413894Sgabeblack@google.com    av.type = swap_byte(av.type);
5513894Sgabeblack@google.com    av.val = swap_byte(av.val);
5613894Sgabeblack@google.com    return av;
5713894Sgabeblack@google.com}
5811854Sbrandon.potter@amd.com
5911854Sbrandon.potter@amd.comenum AuxiliaryVectorType {
6013028Sbrandon.potter@amd.com    M5_AT_NULL = 0,        // End of vector.
6113028Sbrandon.potter@amd.com    M5_AT_IGNORE = 1,      // Ignored.
6213028Sbrandon.potter@amd.com    M5_AT_EXECFD = 2,      // File descriptor of program if interpreter used.
6313028Sbrandon.potter@amd.com    M5_AT_PHDR = 3,        // Address of program header tables in memory.
6413028Sbrandon.potter@amd.com    M5_AT_PHENT = 4,       // Size in bytes of one program header entry.
6513028Sbrandon.potter@amd.com    M5_AT_PHNUM = 5,       // Number of entries in program header table.
6613028Sbrandon.potter@amd.com    M5_AT_PAGESZ = 6,      // System page size.
6713028Sbrandon.potter@amd.com    M5_AT_BASE = 7,        // Base address of interpreter program in memory.
6813028Sbrandon.potter@amd.com    M5_AT_FLAGS = 8,       // Unused.
6913028Sbrandon.potter@amd.com    M5_AT_ENTRY = 9,       // Entry point of program after interpreter setup.
7013028Sbrandon.potter@amd.com    M5_AT_NOTELF = 10,     // Non-zero if format is different than ELF.
7113028Sbrandon.potter@amd.com    M5_AT_UID = 11,        // Address of real user ID of thread.
7213028Sbrandon.potter@amd.com    M5_AT_EUID = 12,       // Address of effective user ID of thread.
7313028Sbrandon.potter@amd.com    M5_AT_GID = 13,        // Address of real group ID of thread.
7413028Sbrandon.potter@amd.com    M5_AT_EGID = 14,       // Address of effective group ID of thread.
7513028Sbrandon.potter@amd.com    M5_AT_PLATFORM = 15,   // Platform string for the architecture.
7613028Sbrandon.potter@amd.com    M5_AT_HWCAP = 16,      // Bits which describe the hardware capabilities.
7713028Sbrandon.potter@amd.com    M5_AT_CLKTCK = 17,     // Frequency at which times() syscall increments.
7813028Sbrandon.potter@amd.com    M5_AT_SECURE = 23,     // Whether to enable "secure mode" in executable.
7913028Sbrandon.potter@amd.com    M5_BASE_PLATFORM = 24, // Platform string (differs on PowerPC only).
8013028Sbrandon.potter@amd.com    M5_AT_RANDOM = 25,     // Pointer to 16 bytes of random data.
8113028Sbrandon.potter@amd.com    M5_AT_HWCAP2 = 26,     // Extension of AT_HWCAP.
8213028Sbrandon.potter@amd.com    M5_AT_EXECFN = 31,     // Filename of the program.
8311854Sbrandon.potter@amd.com    M5_AT_VECTOR_SIZE = 44
8411854Sbrandon.potter@amd.com};
8511854Sbrandon.potter@amd.com
8611854Sbrandon.potter@amd.com#endif // __AUX_VECTOR_HH__
87