Skip to content

Commit

Permalink
scev: Fix librvvm API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
LekKit committed Nov 5, 2024
1 parent 9d96ae6 commit b7e3b1d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/java/lekkit/scev/gui/MachineGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void drawScreen(int mouse_x, int mouse_y, float par3) {
if (texID == 0) {
RVVMNative.loadLib("/usr/lib/librvvm.so");

machine = new RVVMMachine(256, 1, true);
machine = new RVVMMachine(256, 1, "rv64");
new PLIC(machine);
new PCIBus(machine);
new I2CBus(machine);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/lekkit/scev/inventory/InventoryLaptop.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected MachineState buildMachine(UUID uuid) {
return null;
}

MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, true);
MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, "rv64");
if (state == null) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/lekkit/scev/server/MachineManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
public class MachineManager {
private static HashMap<UUID, MachineState> machines = new HashMap<UUID, MachineState>();

public synchronized static MachineState createMachineState(UUID machineUUID, long mem_mb, int smp, boolean rv64) {
public synchronized static MachineState createMachineState(UUID machineUUID, long mem_mb, int smp, String isa) {
MachineState state = getMachineState(machineUUID);
if (state != null) {
System.out.println("Machine already exists!");
return null;
}

state = new MachineState(machineUUID);
if (state.create(mem_mb, smp, rv64)) {
if (state.create(mem_mb, smp, isa)) {
machines.put(machineUUID, state);

return state;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/lekkit/scev/server/MachineState.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public MachineState(UUID machineUUID) {
uuid = machineUUID;
}

public boolean create(long mem_mb, int smp, boolean rv64) {
public boolean create(long mem_mb, int smp, String isa) {
RVVMNative.loadLib("/usr/lib/librvvm.so");

machine = new RVVMMachine(mem_mb, smp, rv64);
machine = new RVVMMachine(mem_mb, smp, isa);
if (machine.isValid()) {
machine.setOption(RVVMMachine.RVVM_OPT_HW_IMITATE, 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected MachineState buildMachine(UUID uuid) {
return null;
}

MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, true);
MachineState state = MachineManager.createMachineState(uuid, mem_mb, 1, "rv64");
if (state == null) {
return null;
}
Expand Down

0 comments on commit b7e3b1d

Please sign in to comment.