ts-7000
[Top] [All Lists]

[ts-7000] reading maverikkey from userspace

To:
Subject: [ts-7000] reading maverikkey from userspace
From: Anish Patel <>
Date: Tue, 14 Dec 2010 02:29:27 -0500
 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/

<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] reading maverikkey from userspace, Anish Patel <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU