Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: src/trusted/validator_x86/RexPrefixes.h

Issue 6883091: Start unit testing for functions in nc_inst_state.c (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_x86/RexPrefixes.h
===================================================================
--- src/trusted/validator_x86/RexPrefixes.h (revision 0)
+++ src/trusted/validator_x86/RexPrefixes.h (revision 0)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2011 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Defines accessor functions for rex prefixes. */
+
+#ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_REXPREFIXES_H_
+#define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_REXPREFIXES_H_
+
+/* Defines the corresponding mask for the bits of the the Rex prefix. */
+#define NaClRexWMask 0x8
+#define NaClRexRMask 0x4
+#define NaClRexXMask 0x2
+#define NaClRexBMask 0x1
+
+/* Defines accessor functions for each of the rex bits. */
+static INLINE uint8_t NaClRexW(uint8_t prefix) {
+ return NaClHasBit(prefix, NaClRexWMask);
+}
+
+static INLINE uint8_t NaClRexR(uint8_t prefix) {
+ return NaClHasBit(prefix, NaClRexRMask);
+}
+
+static INLINE uint8_t NaClRexX(uint8_t prefix) {
+ return NaClHasBit(prefix, NaClRexXMask);
+}
+
+static INLINE uint8_t NaClRexB(uint8_t prefix) {
+ return NaClHasBit(prefix, NaClRexBMask);
+}
+
+/* Defines the range of rex prefix values. */
+#define NaClRexMin 0x40
+#define NaClRexMax 0x4F
+
+#endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_REXPREFIXES_H_ */
Property changes on: src/trusted/validator_x86/RexPrefixes.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698