Update of /cvsroot/emc/emc2/src/emc/motion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7035/emc/motion Modified Files: Tag: pc_2_6_test emcmotcfg.h emcmotglb.c emcmotglb.h motion.c usrmotintf.c usrmotintf.h Log Message: Get rid of SHMEM_BASE_ADDRESS - It is obsolete. Index: usrmotintf.h =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/motion/usrmotintf.h,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** usrmotintf.h 17 Jun 2004 16:09:51 -0000 1.7.2.1 --- usrmotintf.h 21 Jun 2004 01:45:30 -0000 1.7.2.2 *************** *** 26,31 **** extern "C" { #endif ! /* usrmotIniLoad() loads params (SHMEM_KEY, SHMEM_BASE_ADDRESS) from ! named ini file */ extern int usrmotIniLoad(const char *file); /* usrmotReadEmcmotStatus() gets the status info out of --- 26,31 ---- extern "C" { #endif ! /* usrmotIniLoad() loads SHMEM_KEY from named ini file */ ! extern int usrmotIniLoad(const char *file); /* usrmotReadEmcmotStatus() gets the status info out of Index: emcmotglb.h =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/motion/emcmotglb.h,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** emcmotglb.h 17 Jun 2004 16:09:51 -0000 1.1.4.1 --- emcmotglb.h 21 Jun 2004 01:45:30 -0000 1.1.4.2 *************** *** 26,30 **** extern char EMCMOT_INIFILE[EMCMOT_INIFILE_LEN]; - extern unsigned long int SHMEM_BASE_ADDRESS; extern unsigned int SHMEM_KEY; --- 26,29 ---- Index: emcmotcfg.h =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/motion/emcmotcfg.h,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -C2 -d -r1.1.4.1 -r1.1.4.2 *** emcmotcfg.h 17 Jun 2004 16:09:51 -0000 1.1.4.1 --- emcmotcfg.h 21 Jun 2004 01:45:30 -0000 1.1.4.2 *************** *** 33,57 **** /* - base address-- make sure that - - DEFAULT_SHMEM_BASE_ADDRESS + sizeof(EMCMOT_STRUCT) < physical memory - - Examples: - - On a 32 MB computer, with sizeof(EMCMOT_STRUCT) = 241492, - let's set aside 1 MB, so DEFAULT_SHMEM_BASE_ADDRESS is 31 MB: - #define DEFAULT_SHMEM_BASE_ADDRESS = (31*0x100000) - To set up Linux for this, put append="mem=31m" in lilo.conf. - - On a 64 MB computer, with sizeof(EMCMOT_STRUCT) = 1290068, - let's set aside 2 MB, so DEFAULT_SHMEM_BASE_ADDRESS is 62 MB: - #define DEFAULT_SHMEM_BASE_ADDRESS = (62*0x100000) - To set up Linux for this, put append="mem=62m" in lilo.conf. - */ - - /* base address for RTLINUX shared memory */ - #define DEFAULT_SHMEM_BASE_ADDRESS (31*0x100000) - - /* Shared memory keys for simulated motion process. No base address values need to be computed, since operating system does this for us --- 33,36 ---- *************** *** 66,70 **** /* default cycle time for trajectory calculations; cycle time for emcmot.c main loop will be this times the interpolation rate */ ! #if defined(rtlinux) || defined(rtai) #define DEFAULT_TRAJ_CYCLE_TIME 0.010 #define DEFAULT_SERVO_CYCLE_TIME 0.001 --- 45,49 ---- /* default cycle time for trajectory calculations; cycle time for emcmot.c main loop will be this times the interpolation rate */ ! #ifdef RTAPI #define DEFAULT_TRAJ_CYCLE_TIME 0.010 #define DEFAULT_SERVO_CYCLE_TIME 0.001 Index: usrmotintf.c =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/motion/usrmotintf.c,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** usrmotintf.c 17 Jun 2004 16:09:51 -0000 1.10.2.1 --- usrmotintf.c 21 Jun 2004 01:45:30 -0000 1.10.2.2 *************** *** 24,28 **** #include "motion.h" /* EMCMOT_STATUS,CMD */ #include "emcmotcfg.h" /* EMCMOT_ERROR_NUM,LEN */ ! #include "emcmotglb.h" /* SHMEM_BASE_ADDRESS, SHMEM_KEY */ #include "usrmotintf.h" /* these decls */ #include "emcmotlog.h" /* EMCMOT_LOG */ --- 24,28 ---- #include "motion.h" /* EMCMOT_STATUS,CMD */ #include "emcmotcfg.h" /* EMCMOT_ERROR_NUM,LEN */ ! #include "emcmotglb.h" /* SHMEM_KEY */ #include "usrmotintf.h" /* these decls */ #include "emcmotlog.h" /* EMCMOT_LOG */ *************** *** 51,56 **** EMCMOT_STRUCT *emcmotshmem = NULL; // Shared memory base address. ! /* usrmotIniLoad() loads params (SHMEM_KEY, SHMEM_BASE_ADDRESS, ! COMM_TIMEOUT, COMM_WAIT) from named ini file */ int usrmotIniLoad(const char *filename) { --- 51,56 ---- EMCMOT_STRUCT *emcmotshmem = NULL; // Shared memory base address. ! /* usrmotIniLoad() loads params (SHMEM_KEY, COMM_TIMEOUT, COMM_WAIT) ! from named ini file */ int usrmotIniLoad(const char *filename) { *************** *** 83,105 **** } - saveInt = SHMEM_BASE_ADDRESS; - if (NULL != (inistring = iniFind(fp, "SHMEM_BASE_ADDRESS", "EMCMOT"))) { - if (1 == sscanf(inistring, "%lu", &SHMEM_BASE_ADDRESS)) { - /* found it */ - } else { - /* found, but invalid */ - SHMEM_BASE_ADDRESS = saveInt; - rtapi_print - ("invalid [EMCMOT] SHMEM_BASE_ADDRESS in %s (%s); using default %l\n", - filename, inistring, SHMEM_BASE_ADDRESS); - } - } else { - /* not found, using default */ - rtapi_print - ("[EMCMOT] SHMEM_BASE_ADDRESS not found in %s; using default %l\n", - filename, SHMEM_BASE_ADDRESS); - - } - saveDouble = EMCMOT_COMM_TIMEOUT; if (NULL != (inistring = iniFind(fp, "COMM_TIMEOUT", "EMCMOT"))) { --- 83,86 ---- *************** *** 799,802 **** --- 780,788 ---- rtapi_shmem_getptr(shmem_id, (void **) &emcmotStruct); + printf( + "rtapi shmem alloc(%d (0x%X), %d (0x%X) )\n", + SHMEM_KEY, SHMEM_KEY, sizeof(EMCMOT_STRUCT), + sizeof(EMCMOT_STRUCT)); + if (emcmotStruct == NULL) { fprintf(stderr, Index: emcmotglb.c =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/motion/emcmotglb.c,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** emcmotglb.c 17 Jun 2004 16:09:51 -0000 1.2.4.1 --- emcmotglb.c 21 Jun 2004 01:45:30 -0000 1.2.4.2 *************** *** 27,32 **** char EMCMOT_INIFILE[EMCMOT_INIFILE_LEN] = DEFAULT_EMCMOT_INIFILE; - unsigned long int SHMEM_BASE_ADDRESS = DEFAULT_SHMEM_BASE_ADDRESS; - unsigned int SHMEM_KEY = DEFAULT_SHMEM_KEY; --- 27,30 ---- Index: motion.c =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/motion/motion.c,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** motion.c 17 Jun 2004 16:09:51 -0000 1.11.2.1 --- motion.c 21 Jun 2004 01:45:30 -0000 1.11.2.2 *************** *** 42,46 **** microseconds */ /* thread period - default = no thread */ ! static int PERIOD_NSEC = 0; #define DEFAULT_PERIOD 100 MODULE_PARM(PERIOD, "l"); --- 42,46 ---- microseconds */ /* thread period - default = no thread */ ! int PERIOD_NSEC = 0; #define DEFAULT_PERIOD 100 MODULE_PARM(PERIOD, "l"); *************** *** 178,183 **** long period; - extMotInit(); - rtapi_print("motion: initializing...\n"); if (PERIOD <= 0) { --- 178,181 ---- *************** *** 485,488 **** --- 483,488 ---- emcmotStatus->tail = 0; + extMotInit(); + /* set the task priority to second lowest, since we only have one task */ emcmot_prio = rtapi_prio_next_higher(rtapi_prio_lowest()); |