Skip to content

Compilerissues #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dllNetwork/server/ServerSPIInstruction.C
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ uint32_t ServerSPIInstruction::spi_open(Handle ** handle, InstructionStatus & o_
o_status.errorMessage.append(errstr);
}

if (*handle < 0 || (uint32_t)*handle == 0xFFFFFFFF) {
if ( *handle == NULL || (*handle != NULL && (int32_t)*handle < 0) ) {
snprintf(errstr, 200, "ServerSPIInstruction::spi_open Problem opening SPI device %s : errno %d\n", device, errno);
o_status.errorMessage.append(errstr);
rc = o_status.rc = SERVER_SPI_OPEN_FAIL;
Expand Down
20 changes: 18 additions & 2 deletions dllNetwork/server/ServerXDMAInstruction.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,28 @@
#include <cstring>

#include <sys/mman.h>
#include <linux/aspeed-xdma.h>
#include <sys/ioctl.h>
#include <linux/types.h> // needed for __u64, etc types
#include <delay.h>

extern bool global_server_debug;

// data/structures/defines from aspeed-xdma.h
// necessary due to build env not having file in packages yet
#define __ASPEED_XDMA_IOCTL_MAGIC 0xb7
#define ASPEED_XDMA_IOCTL_RESET _IO(__ASPEED_XDMA_IOCTL_MAGIC, 0)

enum aspeed_xdma_direction {
ASPEED_XDMA_DIRECTION_DOWNSTREAM = 0,
ASPEED_XDMA_DIRECTION_UPSTREAM,
};

struct aspeed_xdma_op {
__u64 host_addr;
__u32 len;
__u32 direction;
};

uint32_t ServerXDMAInstruction::xdma_open(Handle ** handle, InstructionStatus & o_status)
{
uint32_t l_rc = 0;
Expand Down Expand Up @@ -77,7 +93,7 @@ uint32_t ServerXDMAInstruction::xdma_open(Handle ** handle, InstructionStatus &
errstr.str(""); errstr.clear();
}

if ( *handle < 0 )
if ( *handle == NULL || (*handle != NULL && (int32_t)*handle < 0) )
{
errstr << "ServerXDMAInstruction::xdma_open Problem opening xdma device " << device.str() << " errno " << errno << std::endl;
o_status.errorMessage.append(errstr.str());
Expand Down