Skip to content

Commit

Permalink
Adjust Go code as well
Browse files Browse the repository at this point in the history
  • Loading branch information
swenson committed Feb 21, 2025
1 parent 5fc3c0b commit dbd46fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion hw-model/c-binding/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ $(OUT)/%.o: $(SOURCE)
$(CC) ${CFLAGS} -g -c $< -o $@

$(TARGET): $(OUT)/debug/libcaliptra_hw_model_c_binding.a $(OBJS)
$(CC) --version
$(CC) -o $(TARGET) $(OBJS) $(CFLAGS) -Wl,-L$(OUT)/debug -lcaliptra_hw_model_c_binding -lpthread -lstdc++ -ldl -lrt -lm

clean:
Expand Down
8 changes: 8 additions & 0 deletions test/dpe_verification/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ static int set_fuses()
return status;
}
// This is needed if CFI is enabled.
__attribute__((aligned(4))) static uint8_t CFI_STATE_ORG[256] = {0}; // leave some extra room
*/
import "C"

Expand All @@ -66,6 +68,12 @@ type CptraModel struct {
// APIs need to be callable from C
var CALIPTRA_C_MODEL *C.struct_caliptra_model

// This is needed if CFI is enabled.
//export cfi_panic_handler
func cfi_panic_handler() {
os.Exit(-1)
}

//export caliptra_write_u32
func caliptra_write_u32(address C.uint32_t, data C.uint32_t) C.int {
result := C.caliptra_model_apb_write_u32(CALIPTRA_C_MODEL, address, data)
Expand Down

0 comments on commit dbd46fa

Please sign in to comment.