Skip to content

Commit

Permalink
sdk: update fpga_pci_write_burst to support >= 16GiB writes
Browse files Browse the repository at this point in the history
  • Loading branch information
AWSjswinney authored and AWSsunandaj committed Apr 19, 2017
1 parent c359f03 commit c8d483c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions sdk/userspace/fpga_libs/fpga_pci/fpga_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fpga_pci_bar_set_mem_base_size(pci_bar_handle_t handle, void *mem_base, size_t m
}

static inline void *
fpga_pci_bar_get_mem_at_offset(pci_bar_handle_t handle, uint64_t offset, uint32_t xaction_size)
fpga_pci_bar_get_mem_at_offset(pci_bar_handle_t handle, uint64_t offset, uint64_t xaction_size)
{
log_debug("handle=%d", handle);

Expand Down Expand Up @@ -380,13 +380,13 @@ fpga_pci_peek64(pci_bar_handle_t handle, uint64_t offset, uint64_t *value) {
return FPGA_ERR_FAIL;
}

int fpga_pci_write_burst(pci_bar_handle_t handle, uint64_t offset, uint32_t* datap, uint32_t dword_len) {
uint32_t i;
int fpga_pci_write_burst(pci_bar_handle_t handle, uint64_t offset, uint32_t* datap, uint64_t dword_len) {
uint64_t i;
log_debug("handle=%d, offset=0x%" PRIx64, handle, offset);

/** get the pointer to the beginning of the range */
uint32_t *reg_ptr = (uint32_t *)fpga_pci_bar_get_mem_at_offset(handle,
offset,sizeof(uint32_t)*dword_len);
offset, sizeof(uint32_t)*dword_len);
fail_on(!reg_ptr, err, "fpga_plat_get_mem_at_offset failed");

/** memcpy */
Expand Down
2 changes: 1 addition & 1 deletion sdk/userspace/include/fpga_pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int fpga_pci_poke64(pci_bar_handle_t handle, uint64_t offset, uint64_t value);
* @returns 0 on success, non-zero on error
*/
int fpga_pci_write_burst(pci_bar_handle_t handle, uint64_t offset,
uint32_t* datap, uint32_t dword_len);
uint32_t* datap, uint64_t dword_len);

/**
* Read a value from a register.
Expand Down

0 comments on commit c8d483c

Please sign in to comment.