14 : _c2h(devicePath +
"/c2h" + std::
to_string(channelIdx), O_RDONLY),
15 _h2c(devicePath +
"/h2c" + std::
to_string(channelIdx), O_WRONLY) {}
19 void DmaIntf::read(uintptr_t address, int32_t* __restrict__ buf,
size_t nbytes) {
20 ssize_t result = ::pread(_c2h, buf, nbytes, address);
21 if(result !=
static_cast<ssize_t
>(nbytes)) {
28 ssize_t result = ::pwrite(_h2c, data, nbytes, address);
29 if(result !=
static_cast<ssize_t
>(nbytes)) {