Merge pull request #1 from ivanmgribeiro/master

Set default build to 64-bit capabilities and fix typo in CHERICC_Fat
This commit is contained in:
Alexandre Joannou
2019-08-02 15:58:57 +01:00
committed by GitHub
2 changed files with 10 additions and 6 deletions

View File

@@ -103,7 +103,7 @@ typedef Bit#(CapAddressW) CapAddress;
// The Hardware permissions type // The Hardware permissions type
typedef struct { typedef struct {
Bool permit_set_CID; Bool permit_set_CID;
Bool acces_sys_regs; Bool access_sys_regs;
Bool permit_unseal; Bool permit_unseal;
Bool permit_ccall; Bool permit_ccall;
Bool permit_seal; Bool permit_seal;
@@ -342,7 +342,7 @@ function Bit#(31) getPerms(CapFat cap);
return zeroExtend({softPerms,hardPerms}); return zeroExtend({softPerms,hardPerms});
endfunction endfunction
function TempFields getTempFields(CapFat cap) = getMetaInfo(cap); function TempFields getTempFields(CapFat cap) = getMetaInfo(cap);
function Bool privileged(CapFat cap) = cap.perms.hard.acces_sys_regs; function Bool privileged(CapFat cap) = cap.perms.hard.access_sys_regs;
function Bool capInBounds(CapFat cap, TempFields tf, Bool inclusive); function Bool capInBounds(CapFat cap, TempFields tf, Bool inclusive);
// Check that the pointer of a capability is currently within the bounds // Check that the pointer of a capability is currently within the bounds
// of the capability // of the capability
@@ -932,7 +932,7 @@ instance CHERICap #(CapPipe, OTypeW, FlagsW, CapAddressW, CapW);
function HardPerms getHardPerms (CapPipe cap); function HardPerms getHardPerms (CapPipe cap);
return HardPerms { return HardPerms {
permitSetCID: cap.capFat.perms.hard.permit_set_CID, permitSetCID: cap.capFat.perms.hard.permit_set_CID,
accessSysRegs: cap.capFat.perms.hard.acces_sys_regs, accessSysRegs: cap.capFat.perms.hard.access_sys_regs,
permitUnseal: cap.capFat.perms.hard.permit_unseal, permitUnseal: cap.capFat.perms.hard.permit_unseal,
permitCCall: cap.capFat.perms.hard.permit_ccall, permitCCall: cap.capFat.perms.hard.permit_ccall,
permitSeal: cap.capFat.perms.hard.permit_seal, permitSeal: cap.capFat.perms.hard.permit_seal,
@@ -949,7 +949,7 @@ instance CHERICap #(CapPipe, OTypeW, FlagsW, CapAddressW, CapW);
function CapPipe setHardPerms (CapPipe cap, HardPerms perms); function CapPipe setHardPerms (CapPipe cap, HardPerms perms);
cap.capFat.perms.hard = HPerms { cap.capFat.perms.hard = HPerms {
permit_set_CID: perms.permitSetCID, permit_set_CID: perms.permitSetCID,
acces_sys_regs: perms.accessSysRegs, access_sys_regs: perms.accessSysRegs,
permit_unseal: perms.permitUnseal, permit_unseal: perms.permitUnseal,
permit_ccall: perms.permitCCall, permit_ccall: perms.permitCCall,
permit_seal: perms.permitSeal, permit_seal: perms.permitSeal,

View File

@@ -1,11 +1,15 @@
CAP ?= 64
CAP ?= 128
ifeq ($(CAP), 128) ifeq ($(CAP), 128)
BSCFLAGS = -D CAP128 BSCFLAGS = -D CAP128
else else
BSCFLAGS = -D CAP64 BSCFLAGS = -D CAP64
endif endif
ARCH ?= RISCV
ifeq ($(ARCH), RISCV)
BSCFLAGS += -D RISCV
endif
verilog-wrappers: CHERICapWrap.bsv CHERICap.bsv CHERICC_Fat.bsv verilog-wrappers: CHERICapWrap.bsv CHERICap.bsv CHERICC_Fat.bsv
bsc $(BSCFLAGS) -verilog -u $< bsc $(BSCFLAGS) -verilog -u $<