aux_vector.hh (13028:9a09c342891e) aux_vector.hh (13894:8603648c1679)
1/*
2 * Copyright (c) 2016 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * For use for simulation and test purposes only
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:

--- 27 unchanged lines hidden (view full) ---

36#ifndef __AUX_VECTOR_HH__
37#define __AUX_VECTOR_HH__
38
39template<class IntType>
40class AuxVector
41{
42 public:
43 AuxVector() = default;
1/*
2 * Copyright (c) 2016 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * For use for simulation and test purposes only
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:

--- 27 unchanged lines hidden (view full) ---

36#ifndef __AUX_VECTOR_HH__
37#define __AUX_VECTOR_HH__
38
39template<class IntType>
40class AuxVector
41{
42 public:
43 AuxVector() = default;
44 AuxVector(IntType type, IntType val);
44 AuxVector(IntType _type, IntType _val) : type(_type), val(_val) {}
45
45
46 IntType const& getAuxType() const { return _auxType; }
47 IntType const& getAuxVal() const { return _auxVal; }
48 IntType const& getHostAuxType() const { return _auxHostType; }
49 IntType const& getHostAuxVal() const { return _auxHostVal; }
50
51 void setAuxType(IntType type);
52 void setAuxVal(IntType val);
53
54 private:
55 IntType _auxType = 0;
56 IntType _auxVal = 0;
57 IntType _auxHostType = 0;
58 IntType _auxHostVal = 0;
46 IntType type = 0;
47 IntType val = 0;
59};
60
48};
49
50template<class IntType>
51inline AuxVector<IntType>
52swap_byte(AuxVector<IntType> av)
53{
54 av.type = swap_byte(av.type);
55 av.val = swap_byte(av.val);
56 return av;
57}
58
61enum AuxiliaryVectorType {
62 M5_AT_NULL = 0, // End of vector.
63 M5_AT_IGNORE = 1, // Ignored.
64 M5_AT_EXECFD = 2, // File descriptor of program if interpreter used.
65 M5_AT_PHDR = 3, // Address of program header tables in memory.
66 M5_AT_PHENT = 4, // Size in bytes of one program header entry.
67 M5_AT_PHNUM = 5, // Number of entries in program header table.
68 M5_AT_PAGESZ = 6, // System page size.

--- 20 unchanged lines hidden ---
59enum AuxiliaryVectorType {
60 M5_AT_NULL = 0, // End of vector.
61 M5_AT_IGNORE = 1, // Ignored.
62 M5_AT_EXECFD = 2, // File descriptor of program if interpreter used.
63 M5_AT_PHDR = 3, // Address of program header tables in memory.
64 M5_AT_PHENT = 4, // Size in bytes of one program header entry.
65 M5_AT_PHNUM = 5, // Number of entries in program header table.
66 M5_AT_PAGESZ = 6, // System page size.

--- 20 unchanged lines hidden ---