I would like to write an integer(just one value, it can be also other type) to a specific register (for example: 0x60006666) on a Linux machine using the ARM platform.
There are many examples using the mmap(2), but it is not clear how to write just one value to a specific address using the mmap(). Having a look at the mmap() manual, it does not specify what value to write to the specific register: http://man7.org/linux/man-pages/man2/mmap.2.html
Here is the function:
void *mmap(void *addr, size_t length, int prot, int flags,
int fd, off_t offset);
It is clear that *addr is the address, but where do we insert the value is written to this address?
In my case I would like to write an int to a specific address, how would mmap look like?
#define _WRITE_ADDR 0x60006666 //address where to write
unsigned int value_addr = 0x00000080 //value to be written to the address
I would like to write the above mentioned value to the specified address. It should be trivial, but not very clear since it has been some time since I worked with this type of questions, hopefully somebody has some hints. Thanks!
Similar question:
WRITE and READ registers in Linux on ARM