OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 /* Defines accessor functions for rex prefixes. */ |
| 8 |
| 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_REXPREFIXES_H_ |
| 10 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_REXPREFIXES_H_ |
| 11 |
| 12 /* Defines the corresponding mask for the bits of the the Rex prefix. */ |
| 13 #define NaClRexWMask 0x8 |
| 14 #define NaClRexRMask 0x4 |
| 15 #define NaClRexXMask 0x2 |
| 16 #define NaClRexBMask 0x1 |
| 17 |
| 18 /* Defines accessor functions for each of the rex bits. */ |
| 19 static INLINE uint8_t NaClRexW(uint8_t prefix) { |
| 20 return NaClHasBit(prefix, NaClRexWMask); |
| 21 } |
| 22 |
| 23 static INLINE uint8_t NaClRexR(uint8_t prefix) { |
| 24 return NaClHasBit(prefix, NaClRexRMask); |
| 25 } |
| 26 |
| 27 static INLINE uint8_t NaClRexX(uint8_t prefix) { |
| 28 return NaClHasBit(prefix, NaClRexXMask); |
| 29 } |
| 30 |
| 31 static INLINE uint8_t NaClRexB(uint8_t prefix) { |
| 32 return NaClHasBit(prefix, NaClRexBMask); |
| 33 } |
| 34 |
| 35 /* Defines the range of rex prefix values. */ |
| 36 #define NaClRexMin 0x40 |
| 37 #define NaClRexMax 0x4F |
| 38 |
| 39 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_REXPREFIXES_H_ */ |
OLD | NEW |