Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

mmap is called with length=1 but more than 1 bytes is later used, this must be wrong #230

Open
yurivict opened this issue Jan 7, 2020 · 2 comments

Comments

@yurivict
Copy link
Contributor

yurivict commented Jan 7, 2020

Here:
https://github.com/vmware/cascade/blob/master/src/cascade/target/core/avmm/de10/de10_config.cc#L83
the second argument (len) is 1, but the returned memory array is used as if it is larger, for example here https://github.com/vmware/cascade/blob/master/src/cascade/target/core/avmm/de10/de10_config.cc#L118 the byte at offset CTRL_OFFSET=4 is used.

This must be wrong. What is the correct len?

@eschkufz
Copy link
Contributor

eschkufz commented Jan 9, 2020

That certainly seems wrong to me. That bit of code was adapted from here:

https://github.com/nhasbun/de10nano_fpga_linux_config/blob/master/main.c

Your guess is as good as mine as to what the correct len should be.

@eschkufz
Copy link
Contributor

It seems like the correct value for length should be GPIO_INTSTATUS+1

@eschkufz eschkufz reopened this Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants