forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargslot.h
42 lines (35 loc) · 1.07 KB
/
argslot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ============================================================================
// 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 uint64_t ARG_SLOT;
#define SIZEOF_ARG_SLOT 8
#if BIGENDIAN
// Returns the address of the payload inside the argslot
inline BYTE* ArgSlotEndiannessFixup(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 ArgSlotEndiannessFixup(pArg, cbSize) ((BYTE *)(pArg))
#endif
#endif // __ARG_SLOT_H__