I would like to declare an array in kernel module and to access it within a userspace app. how can I do it?
How do I memory map it for using via userspace so it can be used by a user?
You will most likely need to implement a character device. Then in your instance of struct file_operations implement the mmap function.
I guess you have everything here: http://www.scs.ch/~frey/linux/memorymap.html
First result on Google, by the way.
Linux Device Driver 3th Chapter 15. It talks about mmap. Chapter 3 and 6 talk about char devices.