2 * Copyright (C) 2013 Freescale Semiconductor, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23 #ifndef SIZEDADDRESS_H
24 #define SIZEDADDRESS_H
32 Class to handle 32 or 64bit (sized) Address data
41 valid_(false), pc64_(false), pc_hi_(0), pc_lo_(0)
44 virtual ~SizedAddress()
48 // Default copy and assignment operators are OK
50 // Comparison operation
51 bool operator==(const SizedAddress
&rhs
) const;
52 bool operator!=(const SizedAddress
&rhs
) const;
54 // XOR compound operation
55 SizedAddress
& operator^=(const SizedAddress
&rhs
);
58 const SizedAddress
operator^(const SizedAddress
&rhs
);
61 @Returns the validity of the address value
62 @return true if the value is valid
69 @Returns the address value
70 @return the address value
72 uint32_t address32() const
78 @Returns the address value
79 @return the address value
81 uint64_t address64() const
83 return ((uint64_t) pc_hi_
<< 32) | (uint64_t) pc_lo_
;
87 @Returns the upper 32bits of the address
88 @return the upper 32bits of the address
90 uint32_t upper32() const
96 @Returns the lower 32bits of the address
97 @return the lower 32bits of the address
99 uint32_t lower32() const
105 @Tests if the address is 64 bit wide
106 @return if the address is 64 bits wide
108 bool is64bits() const
114 @abstract Return the Address as a string
115 @return a string representing the Nexus Address
117 string
asString() const;
120 @Sets the upper 32bits of the address
122 void upper32(uint32_t val
)
130 @Sets the lower 32bits of the address
132 void lower32(uint32_t val
)
140 /*! @var valid_ true if represents an initialized value */
143 /*! @var pc64_ determines if the received address is 64bits wide */
146 /*! @var pc_hi_ the upper 32bits of the Nexus address */
149 /*! @var pc_lo_ the lower 32bits of the Nexus address */
153 #endif // SIZEDADDRESS_H
This page took 0.033317 seconds and 4 git commands to generate.