hi all,
i am trying to figure out how to read the maverikkey from userspace,
without having to grab it from /proc/cpuinfo.
after a lot of googling i finally found a reference that told me what
register to access to get the information, but i am failing at
understanding at how to access the register. I know its a 32bits long,
i tried using inl(0x80832440) which just causes seg faults, then i tried
this
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
using namespace std;
int main(void){
int fd;
fd = open("/dev/mem", O_RDWR | O_CREAT | O_TRUNC);
// cout << "test " << endl;
//cout << hex << EP93XX_AHB_PHYS_BASE << endl;
//unsigned int *serial = (unsigned int *)0x80832440;
unsigned int* serial = (unsigned int*)mmap (0, 32, PROT_READ,
fd,0x80832440,0);
cout << hex << serial << endl;
//printf("%x\n", serial);
return 0;
}
which just returns 0xfffffff
I tried to follow what was happening in the kernel source and kind of
understand, but not understand the
#define IOMEM(p) macro expansion, i also tried coping the io.h and
ep93xx-regs.h to my local directory and trying to get it to work that way.
can someone please give me a hint or nudge in the right direction?
Thanks
Anish
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|