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 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