meier/ptme #129

Merged
muellerr merged 9 commits from meier/ptme into develop 2022-01-26 15:59:11 +01:00
2 changed files with 0 additions and 27 deletions
Showing only changes of commit 03707f2d6a - Show all commits

View File

@ -10,29 +10,10 @@ Ptme::Ptme(object_id_t objectId) : SystemObject(objectId) {}
Ptme::~Ptme() {} Ptme::~Ptme() {}
ReturnValue_t Ptme::initialize() { ReturnValue_t Ptme::initialize() {
int fd = open(PtmeConfig::UIO_DEVICE_FILE, O_RDWR);
if (fd < 1) {
sif::warning << "Ptme::initialize: Invalid UIO device file" << std::endl;
return RETURN_FAILED;
}
/**
* Map uio device in virtual address space
* PROT_WRITE: Map uio device in writable only mode
*/
ptmeBaseAddress = static_cast<uint32_t*>(mmap(NULL, MAP_SIZE, PROT_WRITE, MAP_SHARED, fd,
0 * getpagesize()));
if (ptmeBaseAddress == MAP_FAILED) {
sif::error << "Ptme::initialize: Failed to map uio address" << std::endl;
return RETURN_FAILED;
}
VcInterfaceMapIter iter; VcInterfaceMapIter iter;
for (iter = vcInterfaceMap.begin(); iter != vcInterfaceMap.end(); iter++) { for (iter = vcInterfaceMap.begin(); iter != vcInterfaceMap.end(); iter++) {
iter->second->initialize(); iter->second->initialize();
} }
return RETURN_OK; return RETURN_OK;
} }

View File

@ -44,14 +44,6 @@ class Ptme : public PtmeIF, public SystemObject, public HasReturnvaluesIF {
static const ReturnValue_t UNKNOWN_VC_ID = MAKE_RETURN_CODE(0xA0); static const ReturnValue_t UNKNOWN_VC_ID = MAKE_RETURN_CODE(0xA0);
#if BOARD_TE0720 == 1
/** Size of mapped address space */
static const int MAP_SIZE = 0x40000;
#else
/** Size of mapped address space */
static const int MAP_SIZE = 0x1000;
#endif /* BOARD_TE0720 == 1 */
/** /**
* Configuration bits: * Configuration bits:
* bit[1:0]: Size of data (1,2,3 or 4 bytes). 1 Byte <=> b00 * bit[1:0]: Size of data (1,2,3 or 4 bytes). 1 Byte <=> b00