Add support for RISC-V in ArchUtils #1128

This commit is contained in:
Gary Gregory 2023-11-05 07:36:55 -05:00
parent 4cff6633e9
commit ebca9c9ee8
4 changed files with 8 additions and 7 deletions

View File

@ -79,6 +79,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="add" dev="ggregory" due-to="Gary Gregory">Add ExceptionUtils.throwUnchecked(T) where T extends Throwable, and deprecate Object version.</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add ExceptionUtils.rethrowRuntimeException(T), and deprecate rethrow(T).</action>
<action issue="LANG-1716" type="add" dev="ggregory" due-to="Benjamin Confino, Gary Gregory">ConcurrentInitializer implementations can now be instantiated and configured with allocation and release lambdas.</action>
<action issue="LANG-1717" type="add" dev="ggregory" due-to="Levi Zim, Gary Gregory">Add support for RISC-V in ArchUtils #1128.</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump commons-parent from 58 to 64.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump org.easymock:easymock from 5.1.0 to 5.2.0 #1104.</action>

View File

@ -121,11 +121,11 @@ public class ArchUtils {
}
private static void init_RISCV_32Bit() {
addProcessors(new Processor(Processor.Arch.BIT_32, Processor.Type.RISCV), "riscv32");
addProcessors(new Processor(Processor.Arch.BIT_32, Processor.Type.RISC_V), "riscv32");
}
private static void init_RISCV_64Bit() {
addProcessors(new Processor(Processor.Arch.BIT_64, Processor.Type.RISCV), "riscv64");
addProcessors(new Processor(Processor.Arch.BIT_64, Processor.Type.RISC_V), "riscv64");
}
private static void init_X86_32Bit() {

View File

@ -112,7 +112,7 @@ public class Processor {
*
* @since 3.14.0
*/
RISCV("RISC-V"),
RISC_V("RISC-V"),
/**
* Unknown architecture.
@ -236,11 +236,11 @@ public class Processor {
/**
* Tests if {@link Processor} is type of RISC-V.
*
* @return {@code true}. if {@link Processor} is {@link Type#RISCV}, else {@code false}.
* @return {@code true}. if {@link Processor} is {@link Type#RISC_V}, else {@code false}.
* @since 3.14.0
*/
public boolean isRISCV() {
return Type.RISCV == type;
return Type.RISC_V == type;
}
@Override

View File

@ -104,11 +104,11 @@ public class ArchUtilsTest extends AbstractLangTest {
assertTrue(processor.isAarch64());
processor = ArchUtils.getProcessor(RISCV_32);
assertEqualsTypeNotNull(Processor.Type.RISCV, processor);
assertEqualsTypeNotNull(Processor.Type.RISC_V, processor);
assertTrue(processor.isRISCV());
processor = ArchUtils.getProcessor(RISCV_64);
assertEqualsTypeNotNull(Processor.Type.RISCV, processor);
assertEqualsTypeNotNull(Processor.Type.RISC_V, processor);
assertTrue(processor.isRISCV());
}