This commit is contained in:
parent
102385a707
commit
03707f2d6a
@ -10,29 +10,10 @@ Ptme::Ptme(object_id_t objectId) : SystemObject(objectId) {}
|
||||
Ptme::~Ptme() {}
|
||||
|
||||
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;
|
||||
for (iter = vcInterfaceMap.begin(); iter != vcInterfaceMap.end(); iter++) {
|
||||
iter->second->initialize();
|
||||
}
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
|
@ -44,14 +44,6 @@ class Ptme : public PtmeIF, public SystemObject, public HasReturnvaluesIF {
|
||||
|
||||
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:
|
||||
* bit[1:0]: Size of data (1,2,3 or 4 bytes). 1 Byte <=> b00
|
||||
|
Loading…
Reference in New Issue
Block a user