Using mmap with an sychronous stream

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: Using mmap with an sychronous stream

Re: Using mmap with an sychronous stream

Post by Guest »

Hi Eli,

Thanks for your answer. I'm asking because I want to know in what ways I can treat the file descriptors produced by a call to open. As to why -- its more convenient to change the value of defreferenced pointers than to call write in some cases. However, calling write is perfectly acceptable :).

Best,

Jon

Re: Using mmap with an sychronous stream

Post by support »

Hello,

mmap() isn't supported by Xillybus' driver. Actually, it's not clear to me why you would like to do that.

The closest thing available is seekable streams.

Regards,
Eli

Using mmap with an sychronous stream

Post by Guest »

Hi,

I'm wondering if mmap can be used on a synchronous stream. Lets say I have an 8-bit wide synchronous stream and I want to store pointers to given set of byte values that correspond to a 100 byte array of data on my FPGA.

Code: Select all
int fd, pagesize;
char *fpga_data;

// Open device and mmap
pagesize = getpagesize();
int fd = open("/dev/xillybus_sync8", O_RDWR);
fpga_data = mmap((caddr_t)0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, pagesize);

// Mess with data
*(fpga_data + 10) = 0x22;



Is this possible? Will this mess with the synchronization guarantees that read()/write() provide for synchronous streams?

Thank you.

Top