Hi,
How can a tslinux 2.4 kernel module and an application both access shared
memory? In the app, a shared memory block is created or opened in the the
following code:
#define SHMKEY (ftok("KWHdata", 0x1e))
typedef struct shMem {
int state;
long elapsedSecs;
int counter1;
int counter2;
int counter3;
int counter4;
} sharedMem;
sharedMem *getSharedMem() {
int shmid = shmget(SHMKEY, sizeof(sharedMem), IPC_CREAT | IPC_EXCL | 0x660);
// try to create shared memory
if (shmid == -1) shmid = shmget(SHMKEY, sizeof(sharedMem), 0); // create
failed--try to use existing shared memory
if (shmid == -1) {
perror("Error assigning shared memory");
exit(1);
}
return shmat(shmid, 0, 0);
}
How is the same shared memory accessed from a tslinux 2.4 kernel module (on a
ts-7250)? Are there equivalent routines to ftok and shmget?
The kernel module increments the counters on interrupts. The app needs
read-only access to the counters.
Thanks,
Marv
------------------------------------
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/
|