Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISC-V] Initial commit for libraries directory #90203

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static partial class PlatformDetection
public static bool IsS390xProcess => (int)RuntimeInformation.ProcessArchitecture == 5; // Architecture.S390x
public static bool IsArmv6Process => (int)RuntimeInformation.ProcessArchitecture == 7; // Architecture.Armv6
public static bool IsPpc64leProcess => (int)RuntimeInformation.ProcessArchitecture == 8; // Architecture.Ppc64le
public static bool IsRiscV64Process => (int)RuntimeInformation.ProcessArchitecture == 9; // Architecture.RiscV64;
public static bool IsX64Process => RuntimeInformation.ProcessArchitecture == Architecture.X64;
public static bool IsX86Process => RuntimeInformation.ProcessArchitecture == Architecture.X86;
public static bool IsNotX86Process => !IsX86Process;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,12 @@ public enum Architecture
/// A PowerPC 64-bit (little-endian) processor architecture.
/// </summary>
Ppc64le,
/// <summary>
/// A RiscV 64-bit processor architecture.
/// </summary>
/// <remarks>
/// This value indicates RV64GC set of extensions.
/// </remarks>
RiscV64,
jkotas marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static Architecture ProcessArchitecture
#elif TARGET_POWERPC64
=> Architecture.Ppc64le
#elif TARGET_RISCV64
=> (Architecture)9 // TODO-RISCV64: go though API review for RiscV64
=> Architecture.RiscV64
#else
#error Unknown Architecture
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3293,6 +3293,9 @@ public enum Machine : ushort
Arm64 = (ushort)43620,
LoongArch32 = (ushort)25138,
LoongArch64 = (ushort)25188,
RiscV32 = (ushort)20530,
RiscV64 = (ushort)20580,
RiscV128 = (ushort)20776,
}
public partial class ManagedPEBuilder : System.Reflection.PortableExecutable.PEBuilder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,20 @@ public enum Machine : ushort
/// LOONGARCH64
/// </summary>
LoongArch64 = 0x6264,

/// <summary>
/// RISCV32
/// </summary>
RiscV32 = 0x5032,

/// <summary>
/// RISCV64
/// </summary>
RiscV64 = 0x5064,

/// <summary>
/// RISCV128
/// </summary>
RiscV128 = 0x5128,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public void VerifyArchitecture()
Assert.Equal(Architecture.Ppc64le, processArch);
break;

case Architecture.RiscV64:
Assert.Equal(Architecture.RiscV64, processArch);
break;

default:
Assert.False(true, "Unexpected Architecture.");
break;
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13395,6 +13395,7 @@ public enum Architecture
LoongArch64 = 6,
Armv6 = 7,
Ppc64le = 8,
RiscV64 = 9,
}
public enum CharSet
{
Expand Down
Loading