summaryrefslogtreecommitdiff
path: root/src/vm/argslot.h
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
committerdotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
commitef1e2ab328087c61a6878c1e84f4fc5d710aebce (patch)
treedee1bbb89e9d722e16b0d1485e3cdd1b6c8e2cfa /src/vm/argslot.h
downloadcoreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.gz
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.bz2
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.zip
Initial commit to populate CoreCLR repo
[tfs-changeset: 1407945]
Diffstat (limited to 'src/vm/argslot.h')
-rw-r--r--src/vm/argslot.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/vm/argslot.h b/src/vm/argslot.h
new file mode 100644
index 0000000000..57a7afa8c2
--- /dev/null
+++ b/src/vm/argslot.h
@@ -0,0 +1,44 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+// ============================================================================
+// File: argslot.h
+//
+
+// ============================================================================
+// Contains the ARG_SLOT type.
+
+
+#ifndef __ARG_SLOT_H__
+#define __ARG_SLOT_H__
+
+// The ARG_SLOT must be big enough to represent all pointer and basic types (except for 80-bit fp values).
+// So, it's guaranteed to be at least 64-bit.
+typedef unsigned __int64 ARG_SLOT;
+#define SIZEOF_ARG_SLOT 8
+
+#if BIGENDIAN
+// Returns the address of the payload inside the argslot
+inline BYTE* ArgSlotEndianessFixup(ARG_SLOT* pArg, UINT cbSize) {
+ LIMITED_METHOD_CONTRACT;
+
+ BYTE* pBuf = (BYTE*)pArg;
+ switch (cbSize) {
+ case 1:
+ pBuf += 7;
+ break;
+ case 2:
+ pBuf += 6;
+ break;
+ case 4:
+ pBuf += 4;
+ break;
+ }
+ return pBuf;
+}
+#else
+#define ArgSlotEndianessFixup(pArg, cbSize) ((BYTE *)(pArg))
+#endif
+
+#endif // __ARG_SLOT_H__