On Thu, Mar 31, 2016 at 6:36 PM, Al Grant Al.Grant@arm.com wrote:
It is like mmap() interface I have done for STM, I replied one your previous email on March 1st with addressing how to use the mmap() interface from user space, the subject of that email was "STM memory space", if you cannot find that email in you mailbox, please let me know, I can forward that to you.
Thanks, I got the one where you sent sample code for allocating pages into userspace:
map = (char *)mmap(0, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offset); if (map == MAP_FAILED) { printf("Failed to map %s\n", strerror(errno)); goto out; } printf("Success to map channel(%u~%u) to 0x%x\n", policy->channel, (policy->width - policy->channel), (unsigned long)map); write(fd, trace_data, size); /* unmap the area & error checking */ if (munmap(map, length) == -1) perror("user: Error un-mmapping the file");
So you have mapped channels into userspace and you print out the address in userspace (map) but you don't store anything into it. What I am suggesting
Ah, right, using this address (map) directly has some thing wrong for now, I haven't found the root cause. Now I have to focus the work on getting STM driver upstreamed first, and then I will take a look at what caused the problem. I will get back to you once STM mmap() interface works well.
Thanks, Chunyan
here is an API for generating STP packets by doing those stores, and doing this in a way that's both portable and low-overhead.
Apolpogies if you have already suggested this somewhere else.
Al