Forum Discussion
4 Replies
- Altera_Forum
Honored Contributor
There is a usleep() function, included with the HAL. Regarding newlib, you can find it here:
http://sources.redhat.com/newlib/ (http://sources.redhat.com/newlib/) I think there's also an option to add the sources during kit installation. Cheers, - slacker - Altera_Forum
Honored Contributor
slacker,
Is there a mmap() function in newlib? I found one in "libc/sys/linux/mmap.c". But I cannot find mman.h file from the newlib directory. Does it mean that I only could use that function when I am working on linux? Thanks, Neo - Altera_Forum
Honored Contributor
The source for the newlib shipped with the HAL is in $NIOS2KIT/bin/nios2-gnutools/src/newlib/newlib. You'll need to search for the file you want below there.
I wouldn't recommend using a different version of newlib since doing this can sometimes cause subtle bugs. But as slacker has pointed out, usleep is implemented in the HAL rather than in newlib. There is no mmap function in the HAL because we don't have different memory spaces for kernel and user so using just the standard read/write functions is just as efficient. - Altera_Forum
Honored Contributor
Wombat,
Thanks for your clarification. At the very beginning, I am going to use mmap to implement the virtual mm, how can I do it now? Thanks, Neo