ID:354 - replace/drop caddr_t in IMB

Commit replaces caddr_t in IMB driver with char *. This is a wild guess
replacement, because caddr_t doesn't have to be char *. However, it shouldn't be
used and so shouldn't mmap(). So we'll have to see how things work out.

http://computer-programming-forum.com/47-c-language/556a90938d01f023.htm
This commit is contained in:
Zdenek Styblik 2014-12-23 14:10:34 +01:00
parent 6d4e2bb632
commit 6ca88cb687

View File

@ -1981,7 +1981,7 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
unsigned int length = addressLength; unsigned int length = addressLength;
off_t startpAddress = (off_t)startAddress; off_t startpAddress = (off_t)startAddress;
unsigned int diff; unsigned int diff;
caddr_t startvAddress; char *startvAddress;
if ((startAddress == 0) || (addressLength <= 0)) if ((startAddress == 0) || (addressLength <= 0))
return ACCESN_ERROR; return ACCESN_ERROR;
@ -2000,13 +2000,13 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
startpAddress -= diff; startpAddress -= diff;
length += diff; length += diff;
if ( (startvAddress = mmap( (caddr_t)0, if ( (startvAddress = mmap(0,
length, length,
PROT_READ, PROT_READ,
MAP_SHARED, MAP_SHARED,
fd, fd,
startpAddress startpAddress
) ) == (caddr_t)-1) ) ) == MAP_FAILED)
{ {
char buf[128]; char buf[128];