|
From: <jmk...@us...> - 2003-08-14 04:17:19
|
Update of /cvsroot/emc/rtapi/examples/shmem
In directory sc8-pr-cvs1:/tmp/cvs-serv13345/examples/shmem
Modified Files:
shmemtask.c
Log Message:
Converted shared memory and semaphores from handles to IDs. Added more /proc entries. Examples work under RTAI. Still need to convert fifos.
Index: shmemtask.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/shmem/shmemtask.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** shmemtask.c 13 Aug 2003 05:55:07 -0000 1.8
--- shmemtask.c 14 Aug 2003 04:08:26 -0000 1.9
***************
*** 10,14 ****
static int shmem_task; /* the task ID*/
! static rtapi_shmem_handle shmem_mem; /* the shared memory area */
enum { SHMEM_PERIOD_NSEC = 1000000 }; /* timer period, in nanoseconds */
enum { SHMEM_STACKSIZE = 1024 }; /* how big the stack is */
--- 10,14 ----
static int shmem_task; /* the task ID*/
! static int shmem_mem; /* the shared memory ID */
enum { SHMEM_PERIOD_NSEC = 1000000 }; /* timer period, in nanoseconds */
enum { SHMEM_STACKSIZE = 1024 }; /* how big the stack is */
***************
*** 41,47 ****
/* allocate and initialize the shared memory structure */
! retval = rtapi_shmem_new( key, sizeof(SHMEM_STRUCT), &shmem_mem );
! if ( retval != RTAPI_SUCCESS ) {
! rtapi_print( "shmemtask init: rtapi_shmem_new returned %d\n", retval );
return -1;
}
--- 41,47 ----
/* allocate and initialize the shared memory structure */
! shmem_mem = rtapi_shmem_new( key, sizeof(SHMEM_STRUCT) );
! if ( shmem_mem < 0 ) {
! rtapi_print( "shmemtask init: rtapi_shmem_new returned %d\n", shmem_mem );
return -1;
}
|