You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(105) |
Aug
(245) |
Sep
(165) |
Oct
(100) |
Nov
(92) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(179) |
Feb
(233) |
Mar
(175) |
Apr
(168) |
May
(146) |
Jun
(165) |
Jul
(18) |
Aug
(95) |
Sep
(134) |
Oct
(120) |
Nov
(51) |
Dec
(65) |
| 2005 |
Jan
(96) |
Feb
(100) |
Mar
(113) |
Apr
(82) |
May
(281) |
Jun
(168) |
Jul
(54) |
Aug
(72) |
Sep
(104) |
Oct
(182) |
Nov
(126) |
Dec
(133) |
| 2006 |
Jan
(211) |
Feb
(252) |
Mar
(291) |
Apr
(199) |
May
(345) |
Jun
(282) |
Jul
(272) |
Aug
(261) |
Sep
(287) |
Oct
(464) |
Nov
(233) |
Dec
(210) |
| 2007 |
Jan
(669) |
Feb
(304) |
Mar
(483) |
Apr
(150) |
May
(293) |
Jun
(215) |
Jul
(178) |
Aug
(138) |
Sep
(159) |
Oct
(301) |
Nov
(367) |
Dec
(165) |
| 2008 |
Jan
(171) |
Feb
(148) |
Mar
(150) |
Apr
(180) |
May
(112) |
Jun
(109) |
Jul
(196) |
Aug
(319) |
Sep
(294) |
Oct
(284) |
Nov
(399) |
Dec
(280) |
| 2009 |
Jan
(536) |
Feb
(454) |
Mar
(382) |
Apr
(255) |
May
(321) |
Jun
(318) |
Jul
(412) |
Aug
(226) |
Sep
(76) |
Oct
(251) |
Nov
(134) |
Dec
(101) |
| 2010 |
Jan
(262) |
Feb
(210) |
Mar
(219) |
Apr
(55) |
May
(180) |
Jun
(225) |
Jul
(151) |
Aug
(184) |
Sep
(54) |
Oct
(160) |
Nov
(237) |
Dec
(115) |
| 2011 |
Jan
(141) |
Feb
(68) |
Mar
(204) |
Apr
(329) |
May
(68) |
Jun
(34) |
Jul
(304) |
Aug
(206) |
Sep
(183) |
Oct
(121) |
Nov
(1125) |
Dec
(934) |
| 2012 |
Jan
(466) |
Feb
(161) |
Mar
(314) |
Apr
(63) |
May
(62) |
Jun
(53) |
Jul
(47) |
Aug
(41) |
Sep
(36) |
Oct
(108) |
Nov
(297) |
Dec
(73) |
| 2013 |
Jan
(236) |
Feb
(81) |
Mar
(422) |
Apr
(441) |
May
(86) |
Jun
(177) |
Jul
(146) |
Aug
(140) |
Sep
(93) |
Oct
(126) |
Nov
(133) |
Dec
(230) |
| 2014 |
Jan
(380) |
Feb
(233) |
Mar
(251) |
Apr
(214) |
May
(168) |
Jun
(670) |
Jul
(538) |
Aug
(459) |
Sep
(330) |
Oct
(327) |
Nov
(339) |
Dec
(456) |
| 2015 |
Jan
(188) |
Feb
(426) |
Mar
(186) |
Apr
(71) |
May
(151) |
Jun
(283) |
Jul
(208) |
Aug
(477) |
Sep
(148) |
Oct
(302) |
Nov
(297) |
Dec
(331) |
| 2016 |
Jan
(474) |
Feb
(55) |
Mar
(92) |
Apr
(118) |
May
(286) |
Jun
(751) |
Jul
(494) |
Aug
(166) |
Sep
(97) |
Oct
(216) |
Nov
(41) |
Dec
(78) |
| 2017 |
Jan
(148) |
Feb
(205) |
Mar
(112) |
Apr
(119) |
May
(125) |
Jun
(102) |
Jul
(242) |
Aug
(26) |
Sep
(53) |
Oct
(28) |
Nov
(38) |
Dec
(97) |
| 2018 |
Jan
(71) |
Feb
(49) |
Mar
(43) |
Apr
(13) |
May
(19) |
Jun
(44) |
Jul
(74) |
Aug
(30) |
Sep
(44) |
Oct
(57) |
Nov
(74) |
Dec
(34) |
| 2019 |
Jan
(41) |
Feb
(50) |
Mar
(30) |
Apr
(24) |
May
(44) |
Jun
(101) |
Jul
(94) |
Aug
(123) |
Sep
(101) |
Oct
(81) |
Nov
(48) |
Dec
(51) |
| 2020 |
Jan
(74) |
Feb
(81) |
Mar
(129) |
Apr
(310) |
May
(176) |
Jun
(97) |
Jul
(137) |
Aug
(205) |
Sep
(84) |
Oct
(71) |
Nov
(106) |
Dec
(138) |
| 2021 |
Jan
(117) |
Feb
(94) |
Mar
(89) |
Apr
(71) |
May
(98) |
Jun
(99) |
Jul
(67) |
Aug
(129) |
Sep
(108) |
Oct
(127) |
Nov
(115) |
Dec
(114) |
| 2022 |
Jan
(115) |
Feb
(85) |
Mar
(97) |
Apr
(92) |
May
(102) |
Jun
(109) |
Jul
(168) |
Aug
(230) |
Sep
(183) |
Oct
(106) |
Nov
(109) |
Dec
(146) |
| 2023 |
Jan
(186) |
Feb
(126) |
Mar
(99) |
Apr
(92) |
May
(158) |
Jun
(74) |
Jul
(113) |
Aug
(93) |
Sep
(84) |
Oct
(163) |
Nov
(72) |
Dec
(81) |
| 2024 |
Jan
(71) |
Feb
(85) |
Mar
(63) |
Apr
(50) |
May
(45) |
Jun
(28) |
Jul
(106) |
Aug
(45) |
Sep
(60) |
Oct
(44) |
Nov
(53) |
Dec
(28) |
| 2025 |
Jan
(87) |
Feb
(58) |
Mar
(71) |
Apr
(37) |
May
(37) |
Jun
(46) |
Jul
(74) |
Aug
(26) |
Sep
(55) |
Oct
(43) |
Nov
(58) |
Dec
(34) |
| 2026 |
Jan
(106) |
Feb
(61) |
Mar
(48) |
Apr
(24) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/emc/documents/temp_html/intro/images In directory sc8-pr-cvs1:/tmp/cvs-serv29929 Removed Files: bkisd2.gif whatbrass1.jpg whatbrass2.jpg whatdan1.gif whatpc.gif whatrf45.jpg whatstep1.gif whaty4.gif Log Message: removed old handbook files --- bkisd2.gif DELETED --- --- whatbrass1.jpg DELETED --- --- whatbrass2.jpg DELETED --- --- whatdan1.gif DELETED --- --- whatpc.gif DELETED --- --- whatrf45.jpg DELETED --- --- whatstep1.gif DELETED --- --- whaty4.gif DELETED --- |
|
From: <ray...@us...> - 2003-08-26 18:38:11
|
Update of /cvsroot/emc/documents/temp_html/install/rtlinux In directory sc8-pr-cvs1:/tmp/cvs-serv30491 Removed Files: index.html rh61andrew.html rtl20.html Log Message: removed old handbook files --- index.html DELETED --- --- rh61andrew.html DELETED --- --- rtl20.html DELETED --- |
|
From: <ray...@us...> - 2003-08-26 18:37:26
|
Update of /cvsroot/emc/documents/temp_html/install/emc In directory sc8-pr-cvs1:/tmp/cvs-serv31962 Removed Files: 486.html download.html guenther.html index.html mandrake70.html mandrake71.html nistinstall.html postbininstall.html postdownload.html postsrcinstall.html Log Message: removed old handbook files --- 486.html DELETED --- --- download.html DELETED --- --- guenther.html DELETED --- --- index.html DELETED --- --- mandrake70.html DELETED --- --- mandrake71.html DELETED --- --- nistinstall.html DELETED --- --- postbininstall.html DELETED --- --- postdownload.html DELETED --- --- postsrcinstall.html DELETED --- |
|
From: <ray...@us...> - 2003-08-26 18:23:11
|
Update of /cvsroot/emc/documents/temp_html/part3/images/_vti_cnf In directory sc8-pr-cvs1:/tmp/cvs-serv7016 Removed Files: tb_tkmine.JPG tb_tkstock.JPG tb_xemcmine.JPG tb_xemcstok.JPG tb_yemcmine.JPG tkmine.JPG tkstock.JPG xemcmine.JPG xemcstok.JPG yemcmine.JPG Log Message: removed old handbook files --- tb_tkmine.JPG DELETED --- --- tb_tkstock.JPG DELETED --- --- tb_xemcmine.JPG DELETED --- --- tb_xemcstok.JPG DELETED --- --- tb_yemcmine.JPG DELETED --- --- tkmine.JPG DELETED --- --- tkstock.JPG DELETED --- --- xemcmine.JPG DELETED --- --- xemcstok.JPG DELETED --- --- yemcmine.JPG DELETED --- |
Update of /cvsroot/emc/documents/temp_html/faq/faq In directory sc8-pr-cvs1:/tmp/cvs-serv4817 Removed Files: book1.html c1084.html c15.html c438.html c471.html c752.html docbook.css faq.lyx faq.pdf faq.ps faq.rtf faq.sgml fsck.html x1041.html x1048.html x105.html x1070.html x1077.html x1091.html x1101.html x20.html x332.html x35.html x401.html x404.html x407.html x410.html x416.html x422.html x444.html x447.html x450.html x453.html x456.html x461.html x464.html x468.html Log Message: removed old handbook files --- book1.html DELETED --- --- c1084.html DELETED --- --- c15.html DELETED --- --- c438.html DELETED --- --- c471.html DELETED --- --- c752.html DELETED --- --- docbook.css DELETED --- --- faq.lyx DELETED --- --- faq.pdf DELETED --- --- faq.ps DELETED --- --- faq.rtf DELETED --- --- faq.sgml DELETED --- --- fsck.html DELETED --- --- x1041.html DELETED --- --- x1048.html DELETED --- --- x105.html DELETED --- --- x1070.html DELETED --- --- x1077.html DELETED --- --- x1091.html DELETED --- --- x1101.html DELETED --- --- x20.html DELETED --- --- x332.html DELETED --- --- x35.html DELETED --- --- x401.html DELETED --- --- x404.html DELETED --- --- x407.html DELETED --- --- x410.html DELETED --- --- x416.html DELETED --- --- x422.html DELETED --- --- x444.html DELETED --- --- x447.html DELETED --- --- x450.html DELETED --- --- x453.html DELETED --- --- x456.html DELETED --- --- x461.html DELETED --- --- x464.html DELETED --- --- x468.html DELETED --- |
|
From: <ray...@us...> - 2003-08-26 18:02:52
|
Update of /cvsroot/emc/documents/temp_html/gcode In directory sc8-pr-cvs1:/tmp/cvs-serv1499 Removed Files: canned.html diacomp.html g-code.html variables.html Log Message: removed old handbook files --- canned.html DELETED --- --- diacomp.html DELETED --- --- g-code.html DELETED --- --- variables.html DELETED --- |
Update of /cvsroot/emc/documents/temp_html/gcode/images In directory sc8-pr-cvs1:/tmp/cvs-serv2858 Removed Files: Eight.gif G81.gif G81a.gif G81ex1.gif G81ex2.gif G81g98d.gif G81mult.gif G81ret.gif G87pre.gif G87s1.gif G87s12.gif G87s5.gif Image10.gif Image11.gif Image12.gif Image13.gif Image14.gif Image9.gif Twelve.gif length1.gif offsets.jpg partdraw1.gif varfig1.gif varfig10.gif varfig2.gif varfig3.gif varfig4.gif varfig5.gif varfig6.gif varfig7.gif varfig8.gif varfig9.gif Log Message: removed old handbook files --- Eight.gif DELETED --- --- G81.gif DELETED --- --- G81a.gif DELETED --- --- G81ex1.gif DELETED --- --- G81ex2.gif DELETED --- --- G81g98d.gif DELETED --- --- G81mult.gif DELETED --- --- G81ret.gif DELETED --- --- G87pre.gif DELETED --- --- G87s1.gif DELETED --- --- G87s12.gif DELETED --- --- G87s5.gif DELETED --- --- Image10.gif DELETED --- --- Image11.gif DELETED --- --- Image12.gif DELETED --- --- Image13.gif DELETED --- --- Image14.gif DELETED --- --- Image9.gif DELETED --- --- Twelve.gif DELETED --- --- length1.gif DELETED --- --- offsets.jpg DELETED --- --- partdraw1.gif DELETED --- --- varfig1.gif DELETED --- --- varfig10.gif DELETED --- --- varfig2.gif DELETED --- --- varfig3.gif DELETED --- --- varfig4.gif DELETED --- --- varfig5.gif DELETED --- --- varfig6.gif DELETED --- --- varfig7.gif DELETED --- --- varfig8.gif DELETED --- --- varfig9.gif DELETED --- |
Update of /cvsroot/emc/documents/temp_html/images/.xvpics In directory sc8-pr-cvs1:/tmp/cvs-serv1165 Removed Files: whatbrass1.jpg whatbrass2.jpg whatdan1.gif whatpc.gif whatrf45.jpg whatstep.jpg whatstep1.gif whaty4.gif Log Message: removed old handbook files --- whatbrass1.jpg DELETED --- --- whatbrass2.jpg DELETED --- --- whatdan1.gif DELETED --- --- whatpc.gif DELETED --- --- whatrf45.jpg DELETED --- --- whatstep.jpg DELETED --- --- whatstep1.gif DELETED --- --- whaty4.gif DELETED --- |
Update of /cvsroot/emc/documents/temp_html/part3 In directory sc8-pr-cvs1:/tmp/cvs-serv26066 Removed Files: developer.html editgui1.html emcsh1.html emcsh2.html helpit.html interpolation.html iosh1.html iosh2.html motion.html rcshello.html remote.nml remoteg.html sourcefiles.html sperrev.html troubleshooting.html Log Message: removed old handbook files --- developer.html DELETED --- --- editgui1.html DELETED --- --- emcsh1.html DELETED --- --- emcsh2.html DELETED --- --- helpit.html DELETED --- --- interpolation.html DELETED --- --- iosh1.html DELETED --- --- iosh2.html DELETED --- --- motion.html DELETED --- --- rcshello.html DELETED --- --- remote.nml DELETED --- --- remoteg.html DELETED --- --- sourcefiles.html DELETED --- --- sperrev.html DELETED --- --- troubleshooting.html DELETED --- |
|
From: <ray...@us...> - 2003-08-26 17:08:25
|
Update of /cvsroot/emc/documents/temp_html/stg In directory sc8-pr-cvs1:/tmp/cvs-serv25329 Removed Files: stg.ini stgindex.html Log Message: removed old handbook files --- stg.ini DELETED --- --- stgindex.html DELETED --- |
|
From: <ray...@us...> - 2003-08-26 17:06:02
|
Update of /cvsroot/emc/documents/temp_html In directory sc8-pr-cvs1:/tmp/cvs-serv24902 Removed Files: copyright.html emcsh1.html helpit.html hindex.html htoc.html index.html license.html maintainers.html standard.css todo.html Log Message: removed old handbook files --- copyright.html DELETED --- --- emcsh1.html DELETED --- --- helpit.html DELETED --- --- hindex.html DELETED --- --- htoc.html DELETED --- --- index.html DELETED --- --- license.html DELETED --- --- maintainers.html DELETED --- --- standard.css DELETED --- --- todo.html DELETED --- |
|
From: <wsh...@us...> - 2003-08-26 00:41:33
|
Update of /cvsroot/emc/rcslib/src/cms
In directory sc8-pr-cvs1:/tmp/cvs-serv5009
Added Files:
Tag: wps_multiplat_dev_branch
recvmsgt_no_config.h sendmsgt_no_config.h
Log Message:
.
--- NEW FILE: recvmsgt_no_config.h ---
#ifndef RECVMSGT_NO_CONFIG_H
#define RECVMSGT_NO_CONFIG_H
/* This is neccessary to avoid muliple definitions of fd_set, etc when both
* RPC via PCNFS and Windows Sockets are to be available. */
#ifdef USE_PCNFS
#undef USE_PCNFS
#endif
#include "rcs_defs.hh" /* MSDOS, _Windows */
#if !defined(_Windows) || defined(USE_PCNFS) || defined(gnuwin32)
#ifdef MSDOS
#include <tklib.h>
#else
#include <sys/types.h> /* u_char etc needed by sys/socket.h */
/* fd_set, FD_ZERO, FD_SET */
#include <sys/socket.h> /* stuct msghdr, sendmsg() */
#ifndef VXWORKS
#include <sys/time.h> /* struct timeval */
#else
#include <sys/times.h> /* struct timeval */
#include <sockLib.h> /* recvmsg() */
#endif
#ifndef _Windows
#include <unistd.h> /* select() */
#endif
#endif
#else
#ifdef USE_OLD_WINSOCK
#include <windows.h>
#include <winsock.h> /* select(), typedef fd_set, FD_ZERO, FD_SET, struct */
#else
#include <winsock2.h>
#endif
#endif
#ifndef irix6
#include <math.h> /* fmod() */
#else
/*
Work around for the conflict between the gcc includes and /usr/includes
on some of our SGI's regarding the definition of initstate()
*/
extern double fmod (double, double);
#endif
#include <errno.h> /* errno variable */
#include <string.h> /* strerror() */
#include <stdlib.h> /* malloc(), free() */
#endif
// RECVMSGT_NO_CONFIG_H
--- NEW FILE: sendmsgt_no_config.h ---
#ifndef SENDMSGT_NO_CONFIG_H
#define SENDMSGT_NO_CONFIG_H
#include "rcs_defs.hh" /* MSDOS, _Windows */
/* This is neccessary to avoid muliple definitions of fd_set, etc when both
* RPC via PCNFS and Windows Sockets are to be available. */
#ifdef USE_PCNFS
#undef USE_PCNFS
#endif
#include <sys/types.h> /* u_char etc needed by sys/socket.h */
/* fd_set, FD_ZERO, FD_SET */
#if !defined(DOS_WINDOWS) || defined(gnuwin32)
#include <sys/socket.h> /* stuct msghdr, sendmsg() */
#ifndef VXWORKS
#include <sys/time.h> /* struct timeval */
#else
#include <sys/times.h> /* struct timeval */
#include <sockLib.h> /* sendmsg() */
#endif
#ifndef _Windows
#include <unistd.h> /* select() */
#endif
#else
#if defined(MSDOS) && !defined(WINDOWS)
#include <tklib.h>
#include <sys/socket.h> /* stuct msghdr, sendmsg() */
#include <sys/uio.h> /* stuct iovec */
#else
#ifdef USE_OLD_WINSOCK
#include <winsock.h> /* select(), typedef fd_set, FD_ZERO, FD_SET, struct */
#else
#include <winsock2.h>
#endif
#endif
#endif
#ifndef irix6
#include <math.h> /* fmod() */
#else
/*
Work around for the conflict between the gcc includes and /usr/includes
on some of our SGI's regarding the definition of initstate()
*/
extern double fmod (double, double);
#endif
#include <errno.h> /* errno variable */
#include <string.h> /* strerror() */
#include <stdlib.h> /* DEBUG_MALLOC(), free() */
#endif
// SENDMSGT_NO_CONFIG_H
|
|
From: <wsh...@us...> - 2003-08-26 00:40:04
|
Update of /cvsroot/emc/rcslib/src/cms
In directory sc8-pr-cvs1:/tmp/cvs-serv4684/src/cms
Modified Files:
Tag: wps_multiplat_dev_branch
cmsdiag.cc msghdr.h recvmsgt.c recvmsgt.h sendmsgt.c
sendmsgt.h sokintrf.c tcp_srv.hh udp_srv.cc udp_srv.hh
udpmem.cc
Log Message:
.
Index: cmsdiag.cc
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/cmsdiag.cc,v
retrieving revision 4.34.2.1
retrieving revision 4.34.2.2
diff -C2 -d -r4.34.2.1 -r4.34.2.2
*** cmsdiag.cc 8 Aug 2003 14:21:09 -0000 4.34.2.1
--- cmsdiag.cc 26 Aug 2003 00:39:44 -0000 4.34.2.2
***************
*** 18,26 ****
#endif
! #ifdef WIN32
! #ifndef mingw32
char *winver ();
#endif
- #endif
#include "timer.hh" // etime()
--- 18,24 ----
#endif
! #if defined(WIN32) && (!defined(mingw32) && !defined(HAVE_CONFIG_H))
char *winver ();
#endif
#include "timer.hh" // etime()
***************
*** 156,161 ****
// #ifndef HAVE_UNAME
! #ifdef WIN32
! #ifndef mingw32
char *wvptr = winver ();
if (NULL != wvptr)
--- 154,158 ----
// #ifndef HAVE_UNAME
! #if defined(WIN32) && (!defined(mingw32) && !defined(HAVE_CONFIG_H))
char *wvptr = winver ();
if (NULL != wvptr)
***************
*** 168,172 ****
sysinfo_len += strlen (dpi->host_sysinfo + sysinfo_len);
}
- #endif
#endif
--- 165,168 ----
Index: msghdr.h
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/msghdr.h,v
retrieving revision 4.32
retrieving revision 4.32.2.1
diff -C2 -d -r4.32 -r4.32.2.1
*** msghdr.h 6 Sep 2001 14:32:55 -0000 4.32
--- msghdr.h 26 Aug 2003 00:39:44 -0000 4.32.2.1
***************
*** 3,6 ****
--- 3,49 ----
#define MSGHDR_H
+ #ifdef HAVE_CONFIG_H
+
+ #ifndef RCS_CONFIG_INCLUDE_H
+ #include "rcs_config_include.h"
+ #endif
+
+ #if !defined(HAVE_CADDR_T_TYPE) && !defined(CADDR_T_DEFINED) && !defined(HAVE__CADDR_T)
+ typedef char *caddr_t;
+ #define CADDR_T_DEFINED
+ #endif
+
+ #if !defined(HAVE_STRUCT_IOVEC_TYPE) && !defined(IOVEC_DEFINED)
+ struct iovec
+ {
+ caddr_t iov_base;
+ int iov_len;
+ };
+ typedef struct iovec iovec_t;
+ #define IOVEC_DEFINED
+ #endif
+
+ #if !defined(HAVE_STRUCT_MSGHDR_TYPE) && !defined(MSGHDR_DEFINED)
+ /*
+ * Message header for recvmsg and sendmsg calls.
+ */
+ struct msghdr
+ {
+ caddr_t msg_name; /* optional address */
+ int msg_namelen; /* size of address */
+ struct iovec RCS_FAR *msg_iov; /* scatter/gather array */
+ int msg_iovlen; /* # elements in msg_iov */
+ caddr_t msg_accrights; /* access rights sent/received */
+ int msg_accrightslen;
+ };
+ #define MSGHDR_DEFINED
+ #endif
+
+
+
+ #else
+ /* HAVE_CONFIG_H */
+
+
#include "rcs_defs.hh" /* _Windows */
***************
*** 23,27 ****
#endif
! #if !defined(_Windows) || defined(USE_PCNFS)
#ifndef MSDOS
--- 66,70 ----
#endif
! #if (!defined(_Windows) && !defined(WIN32)) || defined(USE_PCNFS)
#ifndef MSDOS
***************
*** 109,110 ****
--- 152,157 ----
#endif
+ // HAVE_CONFIG_H
+
+ #endif
+ // MSGHDR_H
Index: recvmsgt.c
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/recvmsgt.c,v
retrieving revision 4.33
retrieving revision 4.33.2.1
diff -C2 -d -r4.33 -r4.33.2.1
*** recvmsgt.c 6 May 2003 15:18:15 -0000 4.33
--- recvmsgt.c 26 Aug 2003 00:39:44 -0000 4.33.2.1
***************
*** 1,61 ****
- /* This is neccessary to avoid muliple definitions of fd_set, etc when both
- * RPC via PCNFS and Windows Sockets are to be available. */
- #ifdef USE_PCNFS
- #undef USE_PCNFS
- #endif
-
-
- #include "rcs_defs.hh" /* MSDOS, _Windows */
! #include "recvmsgt.h" /* Forward Prototype */
! #include "_timer.h" /* etime(), etime_disabled */
!
! #if !defined(_Windows) || defined(USE_PCNFS) || defined(gnuwin32)
! #ifdef MSDOS
! #include <tklib.h>
! #else
! #include <sys/types.h> /* u_char etc needed by sys/socket.h */
! /* fd_set, FD_ZERO, FD_SET */
! #include <sys/socket.h> /* stuct msghdr, sendmsg() */
! #ifndef VXWORKS
! #include <sys/time.h> /* struct timeval */
! #else
! #include <sys/times.h> /* struct timeval */
! #include <sockLib.h> /* recvmsg() */
! #endif
! #ifndef _Windows
! #include <unistd.h> /* select() */
! #endif
! #endif
! #else
! #ifdef USE_OLD_WINSOCK
! #include <windows.h>
! #include <winsock.h> /* select(), typedef fd_set, FD_ZERO, FD_SET, struct */
! #else
! #include <winsock2.h>
! #endif
!
! #endif
! #ifndef irix6
! #include <math.h> /* fmod() */
#else
! /*
! Work around for the conflict between the gcc includes and /usr/includes
! on some of our SGI's regarding the definition of initstate()
! */
! extern double fmod (double, double);
#endif
! #include <errno.h> /* errno variable */
! #include <string.h> /* strerror() */
! #include <stdlib.h> /* malloc(), free() */
#include "rcs_prnt.hh" /* rcs_print_error() */
#include "sokintrf.h" /* dl_recvfrom(), dl_select() */
#include "dbg_mem.h" /* DEBUG_FREE,DEBUG_MALLOC,DEBUG_CALLOC */
static long total_bytes_read = 0;
! #if defined(_Windows)
static char RCS_FAR *collection_buffer = NULL;
static long collection_buffer_size = 0;
--- 1,20 ----
! #if HAVE_CONFIG_H
! #include "rcs_config_include.h"
#else
! #include "recvmsgt_no_config.h"
#endif
! #include "recvmsgt.h" /* Forward Prototype */
! #include "_timer.h" /* etime(), etime_disabled */
#include "rcs_prnt.hh" /* rcs_print_error() */
#include "sokintrf.h" /* dl_recvfrom(), dl_select() */
#include "dbg_mem.h" /* DEBUG_FREE,DEBUG_MALLOC,DEBUG_CALLOC */
+ #include "msghdr.h"
static long total_bytes_read = 0;
! #if defined(_Windows) || defined(WIN32)
static char RCS_FAR *collection_buffer = NULL;
static long collection_buffer_size = 0;
***************
*** 93,97 ****
int bytes_read;
int recvmsgt_timed_out = 0;
! #if defined(_Windows)
long required_size, bytes_copied, bytes_to_copy;
int i = 0;
--- 52,56 ----
int bytes_read;
int recvmsgt_timed_out = 0;
! #if defined(_Windows) || defined(WIN32)
long required_size, bytes_copied, bytes_to_copy;
int i = 0;
***************
*** 179,183 ****
}
}
! #if defined(_Windows)
if (_msg_header->msg_iovlen > 1)
{
--- 138,142 ----
}
}
! #if defined(_Windows) || defined(WIN32)
if (_msg_header->msg_iovlen > 1)
{
***************
*** 246,250 ****
free_recvmsg_collection_buffer ()
{
! #if defined(_Windows)
if (NULL != collection_buffer)
{
--- 205,209 ----
free_recvmsg_collection_buffer ()
{
! #if defined(_Windows) || defined(WIN32)
if (NULL != collection_buffer)
{
Index: recvmsgt.h
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/recvmsgt.h,v
retrieving revision 4.32
retrieving revision 4.32.2.1
diff -C2 -d -r4.32 -r4.32.2.1
*** recvmsgt.h 6 Sep 2001 14:32:55 -0000 4.32
--- recvmsgt.h 26 Aug 2003 00:39:44 -0000 4.32.2.1
***************
*** 4,9 ****
#define RECVMSGT_H
#include "rcs_defs.hh" /* MSDOS, _Windows */
!
#ifdef __cplusplus
--- 4,10 ----
#define RECVMSGT_H
+ #ifndef HAVE_CONFIG_H
#include "rcs_defs.hh" /* MSDOS, _Windows */
! #endif
#ifdef __cplusplus
***************
*** 12,16 ****
#endif
! #include "msghdr.h" /* struct msghdr */
int recvmsgt (int fd, struct msghdr *_msg_header, int _flags,
--- 13,17 ----
#endif
! struct msghdr;
int recvmsgt (int fd, struct msghdr *_msg_header, int _flags,
Index: sendmsgt.c
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/sendmsgt.c,v
retrieving revision 4.33
retrieving revision 4.33.2.1
diff -C2 -d -r4.33 -r4.33.2.1
*** sendmsgt.c 6 May 2003 15:18:16 -0000 4.33
--- sendmsgt.c 26 Aug 2003 00:39:44 -0000 4.33.2.1
***************
*** 1,72 ****
!
! /* This is neccessary to avoid muliple definitions of fd_set, etc when both
! * RPC via PCNFS and Windows Sockets are to be available. */
! #ifdef USE_PCNFS
! #undef USE_PCNFS
#endif
-
- #include "rcs_defs.hh" /* MSDOS, _Windows */
#include "dbg_mem.h" // DEBUG_MALLOC, DEBUG_FREE
-
-
#include "sendmsgt.h" /* Forward Prototype */
-
- #include <sys/types.h> /* u_char etc needed by sys/socket.h */
- /* fd_set, FD_ZERO, FD_SET */
-
- #if !defined(DOS_WINDOWS) || defined(gnuwin32)
- #include <sys/socket.h> /* stuct msghdr, sendmsg() */
- #ifndef VXWORKS
- #include <sys/time.h> /* struct timeval */
- #else
- #include <sys/times.h> /* struct timeval */
- #include <sockLib.h> /* sendmsg() */
- #endif
- #ifndef _Windows
- #include <unistd.h> /* select() */
- #endif
- #else
- #if defined(MSDOS) && !defined(WINDOWS)
- #include <tklib.h>
- #include <sys/socket.h> /* stuct msghdr, sendmsg() */
- #include <sys/uio.h> /* stuct iovec */
- #else
- #ifdef USE_OLD_WINSOCK
- #include <winsock.h> /* select(), typedef fd_set, FD_ZERO, FD_SET, struct */
- #else
- #include <winsock2.h>
- #endif
-
- #endif
- #endif
- #ifndef irix6
- #include <math.h> /* fmod() */
- #else
- /*
- Work around for the conflict between the gcc includes and /usr/includes
- on some of our SGI's regarding the definition of initstate()
- */
- extern double fmod (double, double);
- #endif
-
- #include <errno.h> /* errno variable */
- #include <string.h> /* strerror() */
- #include <stdlib.h> /* DEBUG_MALLOC(), free() */
#include "rcs_prnt.hh" /* rcs_print_error() */
#include "sokintrf.h" /* dl_sendto(), dl_select(), dl_WSAGetLastError() */
static long total_bytes_sent = 0;
#define USE_SENDTO
! #if defined(_Windows) && !defined(USE_PCNFS)
#ifndef USE_SENDTO
#define USE_SENDTO
#endif
#endif
-
-
#ifdef USE_SENDTO
--- 1,24 ----
! #if HAVE_CONFIG_H
! #include "rcs_config_include.h"
! #else
! #include "sendmsgt_no_config.h"
#endif
#include "dbg_mem.h" // DEBUG_MALLOC, DEBUG_FREE
#include "sendmsgt.h" /* Forward Prototype */
#include "rcs_prnt.hh" /* rcs_print_error() */
#include "sokintrf.h" /* dl_sendto(), dl_select(), dl_WSAGetLastError() */
+ #include "msghdr.h"
static long total_bytes_sent = 0;
#define USE_SENDTO
! #if ( defined(_Windows) || defined(WIN32)) && !defined(USE_PCNFS)
#ifndef USE_SENDTO
#define USE_SENDTO
#endif
#endif
#ifdef USE_SENDTO
Index: sendmsgt.h
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/sendmsgt.h,v
retrieving revision 4.32
retrieving revision 4.32.2.1
diff -C2 -d -r4.32 -r4.32.2.1
*** sendmsgt.h 6 Sep 2001 14:32:55 -0000 4.32
--- sendmsgt.h 26 Aug 2003 00:39:44 -0000 4.32.2.1
***************
*** 4,8 ****
--- 4,10 ----
#define SENDMSGT_H
+ #ifndef HAVE_CONFIG_H
#include "rcs_defs.hh" /* MSDOS, _Windows */
+ #endif
***************
*** 12,16 ****
#endif
! #include "msghdr.h" /* struct msghdr */
int sendmsgt (int fd, struct msghdr *_msg_header, int _flags,
--- 14,18 ----
#endif
! struct msghdr;
int sendmsgt (int fd, struct msghdr *_msg_header, int _flags,
Index: sokintrf.c
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/sokintrf.c,v
retrieving revision 4.35.2.2
retrieving revision 4.35.2.3
diff -C2 -d -r4.35.2.2 -r4.35.2.3
*** sokintrf.c 22 Aug 2003 20:06:37 -0000 4.35.2.2
--- sokintrf.c 26 Aug 2003 00:39:44 -0000 4.35.2.3
***************
*** 4,7 ****
--- 4,11 ----
#include "rcs_config_include.h"
+ #ifdef WIN32
+ #define USE_WINSOCK
+ #endif
+
#else
#include "sokintrf_no_config.h"
***************
*** 97,101 ****
typedef struct hostent *(RCS_FAR * PTR_TO_GETHOSTBYNAME) (char RCS_FAR *);
extern PTR_TO_GETHOSTBYNAME ptr_to_get_hostbyname;
! #ifdef _WINDOWS
typedef int (RCS_FAR * PTR_TO_WSAISFDSET) (SOCKET, fd_set RCS_FAR *);
extern PTR_TO_WSAISFDSET ptr_to_wsaisfdset;
--- 101,105 ----
typedef struct hostent *(RCS_FAR * PTR_TO_GETHOSTBYNAME) (char RCS_FAR *);
extern PTR_TO_GETHOSTBYNAME ptr_to_get_hostbyname;
! #if defined(_WINDOWS) || defined(WIN32)
typedef int (RCS_FAR * PTR_TO_WSAISFDSET) (SOCKET, fd_set RCS_FAR *);
extern PTR_TO_WSAISFDSET ptr_to_wsaisfdset;
***************
*** 398,402 ****
}
! #ifdef _WINDOWS
int
dl_WSAGetLastError ()
--- 402,406 ----
}
! #if defined(_WINDOWS) || defined(WIN32)
int
dl_WSAGetLastError ()
***************
*** 491,495 ****
#ifndef USE_WINSOCK
#ifndef VXWORKS
! #if defined(MSDOS) && !defined(_Windows)
return tk_ioctl (s, (int) cmd, (int *) argp);
#else
--- 495,499 ----
#ifndef USE_WINSOCK
#ifndef VXWORKS
! #if defined(MSDOS) && (!defined(_Windows) && !defined(WIN32))
return tk_ioctl (s, (int) cmd, (int *) argp);
#else
***************
*** 607,611 ****
dl_inet_netof (struct in_addr addr)
{
! #ifdef WINDOWS
return addr.S_un.S_addr & 0xffffff00;
#else
--- 611,615 ----
dl_inet_netof (struct in_addr addr)
{
! #if defined(WINDOWS) || defined(WIN32)
return addr.S_un.S_addr & 0xffffff00;
#else
***************
*** 624,628 ****
dl_inet_makeaddr (const int net, const int lna)
{
! #ifdef WINDOWS
struct in_addr tempAddress;
tempAddress.S_un.S_addr = ((u_long) net) | ((u_long) lna);
--- 628,632 ----
dl_inet_makeaddr (const int net, const int lna)
{
! #if defined(WINDOWS) || defined(WIN32)
struct in_addr tempAddress;
tempAddress.S_un.S_addr = ((u_long) net) | ((u_long) lna);
Index: tcp_srv.hh
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/tcp_srv.hh,v
retrieving revision 4.33.2.2
retrieving revision 4.33.2.3
diff -C2 -d -r4.33.2.2 -r4.33.2.3
*** tcp_srv.hh 21 Aug 2003 20:24:14 -0000 4.33.2.2
--- tcp_srv.hh 26 Aug 2003 00:39:44 -0000 4.33.2.3
***************
*** 10,13 ****
--- 10,16 ----
class CLIENT_TCP_PORT;
+ struct sockaddr_in;
+ struct timeval;
+
class CMS_SERVER_REMOTE_TCP_PORT:public CMS_SERVER_REMOTE_PORT
{
***************
*** 28,37 ****
int connection_socket;
long connection_port;
! void *ptr_to_server_socket_address;
REMOTE_CMS_REQUEST *request;
char temp_buffer[0x2000];
int current_poll_interval_millis;
int polling_enabled;
! void *ptr_to_select_timeout;
void update_subscriptions ();
void add_subscription_client (int buffer_number, int subscription_type,
--- 31,40 ----
int connection_socket;
long connection_port;
! struct sockaddr_in *ptr_to_server_socket_address;
REMOTE_CMS_REQUEST *request;
char temp_buffer[0x2000];
int current_poll_interval_millis;
int polling_enabled;
! struct timeval *ptr_to_select_timeout;
void update_subscriptions ();
void add_subscription_client (int buffer_number, int subscription_type,
Index: udp_srv.cc
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/udp_srv.cc,v
retrieving revision 4.39.2.1
retrieving revision 4.39.2.2
diff -C2 -d -r4.39.2.1 -r4.39.2.2
*** udp_srv.cc 22 Aug 2003 20:06:37 -0000 4.39.2.1
--- udp_srv.cc 26 Aug 2003 00:39:44 -0000 4.39.2.2
***************
*** 18,21 ****
--- 18,22 ----
#include "timer.hh" // etime(), clk_tck()
#include "_timer.h"
+ #include "msghdr.h" // struct iovec, struct msghdr
class CLIENT_UDP_PORT
***************
*** 59,62 ****
--- 60,73 ----
};
+ class UDP_BROADCAST_DATA
+ {
+ public:
+ int buffer_number;
+ struct sockaddr_in broadcast_address;
+ int broadcast_clnt_port;
+ };
+
+
+
int udp_server_count = 0;
***************
*** 74,88 ****
maxfdpl = 0;
polling_enabled = 0;
! memset (&message_header, 0, sizeof (message_header));
! message_header.msg_name = (caddr_t) NULL;
! message_header.msg_namelen = 0;
! message_header.msg_iov = (struct iovec *) NULL;
! message_header.msg_iovlen = 0;
strcpy (temp_buffer, "UNINITIALIZED");
! memset (&server_socket_address, 0, sizeof (server_socket_address));
! server_socket_address.sin_family = AF_INET;
! server_socket_address.sin_addr.s_addr = dl_htonl (INADDR_ANY);
! server_socket_address.sin_port = 0;
broadcast_subscriptions = 0;
--- 85,110 ----
maxfdpl = 0;
polling_enabled = 0;
! ptr_to_message_header=0;
! ptr_to_select_timeout=0;
! ptr_to_server_socket_address=0;
! ptr_to_broadcast_address=0;
! ptr_to_client_address=0;
!
!
! ptr_to_select_timeout = new struct timeval;
!
! ptr_to_message_header = new struct msghdr;
! memset (ptr_to_message_header, 0, sizeof (struct msghdr));
! ((struct msghdr*)ptr_to_message_header)->msg_name = (caddr_t) NULL;
! ((struct msghdr*)ptr_to_message_header)->msg_namelen = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iov = (struct iovec *) NULL;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 0;
strcpy (temp_buffer, "UNINITIALIZED");
! ptr_to_server_socket_address = new struct sockaddr_in;
! memset (ptr_to_server_socket_address, 0, sizeof (struct sockaddr_in));
! ((struct sockaddr_in*)ptr_to_server_socket_address)->sin_family = AF_INET;
! ((struct sockaddr_in*)ptr_to_server_socket_address)->sin_addr.s_addr = dl_htonl (INADDR_ANY);
! ((struct sockaddr_in*)ptr_to_server_socket_address)->sin_port = 0;
broadcast_subscriptions = 0;
***************
*** 137,140 ****
--- 159,192 ----
subscription_buffers = NULL;
}
+ if(ptr_to_server_socket_address)
+ {
+ delete ptr_to_server_socket_address;
+ ptr_to_server_socket_address=0;
+ }
+ if(ptr_to_client_address)
+ {
+ delete ptr_to_client_address;
+ ptr_to_client_address=0;
+ }
+ if(ptr_to_message_header)
+ {
+ delete ptr_to_message_header;
+ ptr_to_message_header=0;
+ }
+ if(ptr_to_iov2)
+ {
+ delete ptr_to_iov2;
+ ptr_to_iov2=0;
+ }
+ if(ptr_to_broadcast_address)
+ {
+ delete ptr_to_broadcast_address;
+ ptr_to_broadcast_address=0;
+ }
+ if(ptr_to_select_timeout)
+ {
+ delete ptr_to_select_timeout;
+ ptr_to_select_timeout=0;
+ }
}
***************
*** 153,160 ****
CMS_SERVER_REMOTE_UDP_PORT::set_broadcast_address (CMS * _cms)
{
! memset (&broadcast_address, 0, sizeof (broadcast_address));
! broadcast_address.sin_family = AF_INET;
! broadcast_address.sin_addr.s_addr = dl_htonl (INADDR_ANY);
! broadcast_address.sin_port = 0;
char localhostname[80];
if (dl_gethostname (localhostname, 80) < 0)
--- 205,216 ----
CMS_SERVER_REMOTE_UDP_PORT::set_broadcast_address (CMS * _cms)
{
! if(0 == ptr_to_broadcast_address)
! {
! ptr_to_broadcast_address = new struct sockaddr_in;
! }
! memset (ptr_to_broadcast_address, 0, sizeof (struct sockaddr_in));
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_family = AF_INET;
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_addr.s_addr = dl_htonl (INADDR_ANY);
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_port = 0;
char localhostname[80];
if (dl_gethostname (localhostname, 80) < 0)
***************
*** 178,191 ****
}
#ifdef __MSDOS__
! broadcast_address.sin_addr.s_addr =
*((u_long *) broadcast_server_host_entry->h_addr_list[0]);
#else
! broadcast_address.sin_addr.s_addr =
*((int *) broadcast_server_host_entry->h_addr_list[0]);
#endif
! broadcast_address.sin_family = broadcast_server_host_entry->h_addrtype;
#else
! broadcast_address.sin_addr.s_addr = hostGetByName (localhostname);
! if (broadcast_address.sin_addr.s_addr == ERROR)
{
rcs_print_error ("UDPMEM: Couldn't get host address for (%s).\n",
--- 234,247 ----
}
#ifdef __MSDOS__
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_addr.s_addr =
*((u_long *) broadcast_server_host_entry->h_addr_list[0]);
#else
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_addr.s_addr =
*((int *) broadcast_server_host_entry->h_addr_list[0]);
#endif
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_family = broadcast_server_host_entry->h_addrtype;
#else
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_addr.s_addr = hostGetByName (localhostname);
! if (((struct sockaddr_in*)ptr_to_broadcast_address)->sin_addr.s_addr == ERROR)
{
rcs_print_error ("UDPMEM: Couldn't get host address for (%s).\n",
***************
*** 194,200 ****
}
#endif
! broadcast_address.sin_addr.s_addr |= dl_htonl (0xff);
rcs_print_debug (PRINT_SOCKET_CONNECT, "Broadcasting to IP address %s.\n",
! dl_inet_ntoa (broadcast_address.sin_addr));
broadcast_address_set = 1;
}
--- 250,256 ----
}
#endif
! ((struct sockaddr_in*)ptr_to_broadcast_address)->sin_addr.s_addr |= dl_htonl (0xff);
rcs_print_debug (PRINT_SOCKET_CONNECT, "Broadcasting to IP address %s.\n",
! dl_inet_ntoa (((struct sockaddr_in*)ptr_to_broadcast_address)->sin_addr));
broadcast_address_set = 1;
}
***************
*** 227,233 ****
}
! if (server_socket_address.sin_port == 0)
{
! server_socket_address.sin_port =
dl_htons (((u_short) _cms->udp_port_number));
connection_port = _cms->udp_port_number;
--- 283,289 ----
}
! if (((struct sockaddr_in*)ptr_to_server_socket_address)->sin_port == 0)
{
! ((struct sockaddr_in*)ptr_to_server_socket_address)->sin_port =
dl_htons (((u_short) _cms->udp_port_number));
connection_port = _cms->udp_port_number;
***************
*** 248,252 ****
}
UDP_BROADCAST_DATA *broadcast_data = new UDP_BROADCAST_DATA ();
! memcpy (&(broadcast_data->broadcast_address), &broadcast_address,
sizeof (sockaddr_in));
broadcast_data->buffer_number = _cms->buffer_number;
--- 304,308 ----
}
UDP_BROADCAST_DATA *broadcast_data = new UDP_BROADCAST_DATA ();
! memcpy (&(broadcast_data->broadcast_address), ptr_to_broadcast_address,
sizeof (sockaddr_in));
broadcast_data->buffer_number = _cms->buffer_number;
***************
*** 263,267 ****
return 1;
}
! else if (server_socket_address.sin_port ==
dl_htons (((u_short) _cms->udp_port_number)))
{
--- 319,323 ----
return 1;
}
! else if (((struct sockaddr_in*)ptr_to_server_socket_address)->sin_port ==
dl_htons (((u_short) _cms->udp_port_number)))
{
***************
*** 313,317 ****
}
UDP_BROADCAST_DATA *broadcast_data = new UDP_BROADCAST_DATA ();
! memcpy (&(broadcast_data->broadcast_address), &broadcast_address,
sizeof (sockaddr_in));
broadcast_data->buffer_number = _cms->buffer_number;
--- 369,373 ----
}
UDP_BROADCAST_DATA *broadcast_data = new UDP_BROADCAST_DATA ();
! memcpy (&(broadcast_data->broadcast_address), ptr_to_broadcast_address,
sizeof (sockaddr_in));
broadcast_data->buffer_number = _cms->buffer_number;
***************
*** 338,342 ****
{
port_registered = 0;
! if (server_socket_address.sin_port == 0)
{
rcs_print_error ("server can not register on port number 0.\n");
--- 394,398 ----
{
port_registered = 0;
! if (((struct sockaddr_in*)ptr_to_server_socket_address)->sin_port == 0)
{
rcs_print_error ("server can not register on port number 0.\n");
***************
*** 360,365 ****
}
}
! if (dl_bind (connection_socket, (struct sockaddr *) &server_socket_address,
! sizeof (server_socket_address)) < 0)
{
rcs_print_error ("Server can not bind the connection socket.\n");
--- 416,421 ----
}
}
! if (dl_bind (connection_socket, (struct sockaddr *)ptr_to_server_socket_address,
! sizeof (struct sockaddr_in)) < 0)
{
rcs_print_error ("Server can not bind the connection socket.\n");
***************
*** 402,412 ****
exit (-1);
}
! memset (&client_address, 0, sizeof (client_address));
! client_address.sin_family = AF_INET;
! client_address.sin_addr.s_addr = dl_htonl (INADDR_ANY);
! client_address.sin_port = 0;
! message_header.msg_name = (caddr_t) & client_address;
! message_header.msg_namelen = client_addresslen = sizeof (client_address);
request_header_size = 20;
--- 458,469 ----
exit (-1);
}
! ptr_to_client_address = new struct sockaddr_in;
! memset (ptr_to_client_address, 0, sizeof (struct sockaddr_in));
! ((struct sockaddr_in*)ptr_to_client_address)->sin_family = AF_INET;
! ((struct sockaddr_in*)ptr_to_client_address)->sin_addr.s_addr = dl_htonl (INADDR_ANY);
! ((struct sockaddr_in*)ptr_to_client_address)->sin_port = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_name = (caddr_t) ptr_to_client_address;
! ((struct msghdr*)ptr_to_message_header)->msg_namelen = client_addresslen = sizeof (struct sockaddr_in);
request_header_size = 20;
***************
*** 421,437 ****
cms_server_count++;
while (1)
{
! iov2[0].iov_base = temp_buffer;
! iov2[0].iov_len = request_header_size;
! iov2[1].iov_base = (char *) server->write_req.data;
! iov2[1].iov_len = server->maximum_cms_size * 4;
! message_header.msg_iov = iov2;
! message_header.msg_iovlen = 2;
if (polling_enabled)
{
request_length = recvmsgtq (connection_socket,
! &message_header, 0, dtimeout);
if (request_length == 0 && polling_enabled)
{
--- 478,495 ----
cms_server_count++;
+ ptr_to_iov2 = new struct iovec[2];
while (1)
{
! ptr_to_iov2[0].iov_base = temp_buffer;
! ptr_to_iov2[0].iov_len = request_header_size;
! ptr_to_iov2[1].iov_base = (char *) server->write_req.data;
! ptr_to_iov2[1].iov_len = server->maximum_cms_size * 4;
! ((struct msghdr*)ptr_to_message_header)->msg_iov = ptr_to_iov2;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 2;
if (polling_enabled)
{
request_length = recvmsgtq (connection_socket,
! ptr_to_message_header, 0, dtimeout);
if (request_length == 0 && polling_enabled)
{
***************
*** 443,447 ****
{
request_length = recvmsgt (connection_socket,
! &message_header, 0, -1.0);
}
if (request_length < 0)
--- 501,505 ----
{
request_length = recvmsgt (connection_socket,
! ptr_to_message_header, 0, -1.0);
}
if (request_length < 0)
***************
*** 508,513 ****
}
*((u_long *) temp_buffer) = dl_htonl (serial_number); /* used to check for missing or out or order packets */
! iov2[0].iov_base = temp_buffer;
! iov2[0].iov_len = reply_header_size;
switch (request_type)
--- 566,571 ----
}
*((u_long *) temp_buffer) = dl_htonl (serial_number); /* used to check for missing or out or order packets */
! ptr_to_iov2[0].iov_base = temp_buffer;
! ptr_to_iov2[0].iov_len = reply_header_size;
switch (request_type)
***************
*** 530,536 ****
*((u_long *) temp_buffer + 3) = dl_htonl (0); /* write_id */
*((u_long *) temp_buffer + 4) = dl_htonl (0); /* was_read */
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
return;
}
--- 588,594 ----
*((u_long *) temp_buffer + 3) = dl_htonl (0); /* write_id */
*((u_long *) temp_buffer + 4) = dl_htonl (0); /* was_read */
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
return;
}
***************
*** 539,546 ****
*((u_long *) temp_buffer + 1) = dl_htonl (namereply->status);
*((u_long *) temp_buffer + 2) = dl_htonl (name_data_len);
! iov2[1].iov_base = (char *) namereply->name;
! iov2[1].iov_len = name_data_len;
! message_header.msg_iovlen = 2;
! reply_length = sendmsgt (connection_socket, &message_header, 0, -1.0);
if (reply_length != name_data_len + 20)
{
--- 597,604 ----
*((u_long *) temp_buffer + 1) = dl_htonl (namereply->status);
*((u_long *) temp_buffer + 2) = dl_htonl (name_data_len);
! ptr_to_iov2[1].iov_base = (char *) namereply->name;
! ptr_to_iov2[1].iov_len = name_data_len;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 2;
! reply_length = sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
if (reply_length != name_data_len + 20)
{
***************
*** 557,564 ****
int poll_interval_millis = dl_ntohl (*((u_long *) temp_buffer + 4));
int last_read_id = dl_ntohl (*((u_long *) temp_buffer + 5));
! CLIENT_UDP_PORT *new_clnt_port = get_client_port (&client_address);
! memcpy (&(new_clnt_port->client_socket_address), &client_address,
sizeof (struct sockaddr_in));
! memcpy (&(new_clnt_port->reply_message_header), &message_header,
sizeof (struct msghdr));
new_clnt_port->reply_message_header.msg_name =
--- 615,622 ----
int poll_interval_millis = dl_ntohl (*((u_long *) temp_buffer + 4));
int last_read_id = dl_ntohl (*((u_long *) temp_buffer + 5));
! CLIENT_UDP_PORT *new_clnt_port = get_client_port (ptr_to_client_address);
! memcpy (&(new_clnt_port->client_socket_address), ptr_to_client_address,
sizeof (struct sockaddr_in));
! memcpy (&(new_clnt_port->reply_message_header), ptr_to_message_header,
sizeof (struct msghdr));
new_clnt_port->reply_message_header.msg_name =
***************
*** 605,613 ****
*((u_long *) temp_buffer + 1) = dl_htonl (1);
*((u_long *) temp_buffer + 2) = dl_htonl (subscription_id);
! iov2[1].iov_base = 0;
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
reply_length =
! sendmsgt (connection_socket, &(message_header), 0, -1.0);
if (reply_length != 20)
{
--- 663,671 ----
*((u_long *) temp_buffer + 1) = dl_htonl (1);
*((u_long *) temp_buffer + 2) = dl_htonl (subscription_id);
! ptr_to_iov2[1].iov_base = 0;
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
reply_length =
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
if (reply_length != 20)
{
***************
*** 634,640 ****
*((u_long *) temp_buffer + 3) = dl_htonl (0); /* write_id */
*((u_long *) temp_buffer + 4) = dl_htonl (0); /* was_read */
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
return;
}
--- 692,698 ----
*((u_long *) temp_buffer + 3) = dl_htonl (0); /* write_id */
*((u_long *) temp_buffer + 4) = dl_htonl (0); /* was_read */
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
return;
}
***************
*** 643,650 ****
*((u_long *) temp_buffer + 3) = dl_htonl (server->read_reply->write_id);
*((u_long *) temp_buffer + 4) = dl_htonl (server->read_reply->was_read);
! iov2[1].iov_base = (char *) server->read_reply->data;
! iov2[1].iov_len = server->read_reply->size;
! message_header.msg_iovlen = 2;
! reply_length = sendmsgt (connection_socket, &message_header, 0, -1.0);
if (reply_length != server->read_reply->size + 20)
{
--- 701,708 ----
*((u_long *) temp_buffer + 3) = dl_htonl (server->read_reply->write_id);
*((u_long *) temp_buffer + 4) = dl_htonl (server->read_reply->was_read);
! ptr_to_iov2[1].iov_base = (char *) server->read_reply->data;
! ptr_to_iov2[1].iov_len = server->read_reply->size;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 2;
! reply_length = sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
if (reply_length != server->read_reply->size + 20)
{
***************
*** 675,681 ****
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
return;
}
--- 733,739 ----
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
return;
}
***************
*** 686,692 ****
*((u_long *) temp_buffer + 2) =
dl_htonl (server->write_reply->was_read);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
}
break;
--- 744,750 ----
*((u_long *) temp_buffer + 2) =
dl_htonl (server->write_reply->was_read);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
}
break;
***************
*** 703,708 ****
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! iov2[1].iov_len = 0;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
return;
}
--- 761,766 ----
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! ptr_to_iov2[1].iov_len = 0;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
return;
}
***************
*** 711,717 ****
*((u_long *) temp_buffer + 2) =
dl_htonl (server->check_if_read_reply->was_read);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
break;
--- 769,775 ----
*((u_long *) temp_buffer + 2) =
dl_htonl (server->check_if_read_reply->was_read);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
break;
***************
*** 728,733 ****
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! iov2[1].iov_len = 0;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
return;
}
--- 786,791 ----
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! ptr_to_iov2[1].iov_len = 0;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
return;
}
***************
*** 736,742 ****
*((u_long *) temp_buffer + 2) =
dl_htonl (server->get_msg_count_reply->count);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
break;
--- 794,800 ----
*((u_long *) temp_buffer + 2) =
dl_htonl (server->get_msg_count_reply->count);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
break;
***************
*** 752,757 ****
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! iov2[1].iov_len = 0;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
return;
}
--- 810,815 ----
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! ptr_to_iov2[1].iov_len = 0;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
return;
}
***************
*** 760,766 ****
*((u_long *) temp_buffer + 2) =
dl_htonl (server->get_queue_length_reply->queue_length);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
break;
--- 818,824 ----
*((u_long *) temp_buffer + 2) =
dl_htonl (server->get_queue_length_reply->queue_length);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
break;
***************
*** 776,781 ****
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! iov2[1].iov_len = 0;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
return;
}
--- 834,839 ----
dl_htonl ((unsigned long) CMS_SERVER_SIDE_ERROR);
*((u_long *) temp_buffer + 2) = dl_htonl (0); /* was_read */
! ptr_to_iov2[1].iov_len = 0;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
return;
}
***************
*** 784,790 ****
*((u_long *) temp_buffer + 2) =
dl_htonl (server->get_space_available_reply->space_available);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! sendmsgt (connection_socket, &message_header, 0, -1.0);
break;
--- 842,848 ----
*((u_long *) temp_buffer + 2) =
dl_htonl (server->get_space_available_reply->space_available);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1.0);
break;
***************
*** 799,810 ****
*((u_long *) temp_buffer + 1) =
dl_htonl ((u_long) CMS_SERVER_SIDE_ERROR);
! iov2[1].iov_len = 0;
! sendmsgt (connection_socket, &message_header, 0, -1);
return;
}
*((u_long *) temp_buffer + 1) = dl_htonl (server->clear_reply->status);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! //sendmsgt(connection_socket, &message_header, 0, -1);
break;
--- 857,868 ----
*((u_long *) temp_buffer + 1) =
dl_htonl ((u_long) CMS_SERVER_SIDE_ERROR);
! ptr_to_iov2[1].iov_len = 0;
! sendmsgt (connection_socket, ptr_to_message_header, 0, -1);
return;
}
*((u_long *) temp_buffer + 1) = dl_htonl (server->clear_reply->status);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! //sendmsgt(connection_socket, ptr_to_message_header, 0, -1);
break;
***************
*** 816,822 ****
case REMOTE_CMS_CLOSE_CHANNEL_REQUEST_TYPE:
*((u_long *) temp_buffer + 1) = dl_htonl (CMS_CLEAR_OK);
! iov2[1].iov_len = 0;
! message_header.msg_iovlen = 1;
! //sendmsgt(connection_socket, &message_header, 0, -1);
break;
--- 874,880 ----
case REMOTE_CMS_CLOSE_CHANNEL_REQUEST_TYPE:
*((u_long *) temp_buffer + 1) = dl_htonl (CMS_CLEAR_OK);
! ptr_to_iov2[1].iov_len = 0;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 1;
! //sendmsgt(connection_socket, ptr_to_message_header, 0, -1);
break;
***************
*** 1082,1088 ****
if (NULL == subscription_buffers)
{
current_poll_interval_millis = min_poll_interval_millis;
! select_timeout.tv_sec = 30;
! select_timeout.tv_usec = 0;
return;
}
--- 1140,1150 ----
if (NULL == subscription_buffers)
{
+ if(0 == ptr_to_select_timeout)
+ {
+ ptr_to_select_timeout = new struct timeval;
+ }
current_poll_interval_millis = min_poll_interval_millis;
! ((struct timeval*)ptr_to_select_timeout)->tv_sec = 30;
! ((struct timeval*)ptr_to_select_timeout)->tv_usec = 0;
return;
}
***************
*** 1118,1123 ****
{
current_poll_interval_millis = min_poll_interval_millis;
! select_timeout.tv_sec = current_poll_interval_millis / 1000;
! select_timeout.tv_usec = (current_poll_interval_millis % 1000) * 1000;
dtimeout = (current_poll_interval_millis) / 1000.0;
}
--- 1180,1185 ----
{
current_poll_interval_millis = min_poll_interval_millis;
! ((struct timeval*)ptr_to_select_timeout)->tv_sec = current_poll_interval_millis / 1000;
! ((struct timeval*)ptr_to_select_timeout)->tv_usec = (current_poll_interval_millis % 1000) * 1000;
dtimeout = (current_poll_interval_millis) / 1000.0;
}
***************
*** 1129,1134 ****
current_poll_interval_millis++;
}
! select_timeout.tv_sec = current_poll_interval_millis / 1000;
! select_timeout.tv_usec = (long) (ceil (clk_tck () * 1E6));
dtimeout = clk_tck ();
}
--- 1191,1196 ----
current_poll_interval_millis++;
}
! ((struct timeval*)ptr_to_select_timeout)->tv_sec = current_poll_interval_millis / 1000;
! ((struct timeval*)ptr_to_select_timeout)->tv_usec = (long) (ceil (clk_tck () * 1E6));
dtimeout = clk_tck ();
}
***************
*** 1214,1224 ****
buf_info->max_serial_number++;
*((u_long *) temp_buffer) = dl_htonl (buf_info->max_serial_number);
! iov2[0].iov_len = reply_header_size;
! iov2[1].iov_base = (caddr_t) server->read_reply->data;
! iov2[1].iov_len = server->read_reply->size;
! message_header.msg_iovlen = 2;
! message_header.msg_name =
(caddr_t) & (buf_info->broadcast_data->broadcast_address);
! if (sendmsgt (connection_socket, &message_header, 0, dtimeout) < 0)
{
//rcs_print_sys_error(ERRNO_ERROR_SOURCE,"sendmsg error");
--- 1276,1286 ----
buf_info->max_serial_number++;
*((u_long *) temp_buffer) = dl_htonl (buf_info->max_serial_number);
! ptr_to_iov2[0].iov_len = reply_header_size;
! ptr_to_iov2[1].iov_base = (caddr_t) server->read_reply->data;
! ptr_to_iov2[1].iov_len = server->read_reply->size;
! ((struct msghdr*)ptr_to_message_header)->msg_iovlen = 2;
! ((struct msghdr*)ptr_to_message_header)->msg_name =
(caddr_t) & (buf_info->broadcast_data->broadcast_address);
! if (sendmsgt (connection_socket, ptr_to_message_header, 0, dtimeout) < 0)
{
//rcs_print_sys_error(ERRNO_ERROR_SOURCE,"sendmsg error");
***************
*** 1227,1231 ****
(UDP_BUFFER_SUBSCRIPTION_INFO *)
subscription_buffers->get_next ();
! message_header.msg_name = (caddr_t) & client_address;
continue;
}
--- 1289,1293 ----
(UDP_BUFFER_SUBSCRIPTION_INFO *)
subscription_buffers->get_next ();
! ((struct msghdr*)ptr_to_message_header)->msg_name = (caddr_t) ptr_to_client_address;
continue;
}
***************
*** 1357,1361 ****
--- 1419,1428 ----
socket_fd = -1;
subscriptions = NULL;
+ #ifndef WIN32
tid = -1;
pid = -1;
+ #else
+ tid = 0;
+ pid = 0;
+ #endif
}
Index: udp_srv.hh
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/udp_srv.hh,v
retrieving revision 4.33.2.2
retrieving revision 4.33.2.3
diff -C2 -d -r4.33.2.2 -r4.33.2.3
*** udp_srv.hh 22 Aug 2003 20:06:37 -0000 4.33.2.2
--- udp_srv.hh 26 Aug 2003 00:39:44 -0000 4.33.2.3
***************
*** 12,15 ****
--- 12,21 ----
class CLIENT_UDP_PORT;
+ struct sockaddr_in;
+ struct hostent;
+ struct iovec;
+ struct msghdr;
+ struct timeval;
+
class CMS_SERVER_REMOTE_UDP_PORT:public CMS_SERVER_REMOTE_PORT
{
***************
*** 31,47 ****
int connection_socket;
long connection_port;
! struct sockaddr_in server_socket_address;
REMOTE_CMS_REQUEST *request;
char temp_buffer[32];
CMS_SERVER *server;
! struct sockaddr_in client_address;
! struct msghdr message_header;
int client_addresslen;
double polling_period;
! struct iovec iov2[2];
RCS_LINKED_LIST *subscription_buffers;
int current_poll_interval_millis;
int polling_enabled;
! struct timeval select_timeout;
void update_subscriptions ();
void add_subscription_client (int buffer_number, int subdiv,
--- 37,53 ----
int connection_socket;
long connection_port;
! struct sockaddr_in *ptr_to_server_socket_address;
REMOTE_CMS_REQUEST *request;
char temp_buffer[32];
CMS_SERVER *server;
! struct sockaddr_in *ptr_to_client_address;
! struct msghdr *ptr_to_message_header;
int client_addresslen;
double polling_period;
! struct iovec *ptr_to_iov2;
RCS_LINKED_LIST *subscription_buffers;
int current_poll_interval_millis;
int polling_enabled;
! struct timeval *ptr_to_select_timeout;
void update_subscriptions ();
void add_subscription_client (int buffer_number, int subdiv,
***************
*** 59,63 ****
int request_header_size;
int reply_header_size;
! struct sockaddr_in broadcast_address;
int broadcast_address_set;
void set_broadcast_address (CMS *);
--- 65,69 ----
int request_header_size;
int reply_header_size;
! struct sockaddr_in *ptr_to_broadcast_address;
int broadcast_address_set;
void set_broadcast_address (CMS *);
***************
*** 66,77 ****
#endif
int broadcast_subscriptions;
- };
-
- class UDP_BROADCAST_DATA
- {
- public:
- int buffer_number;
- struct sockaddr_in broadcast_address;
- int broadcast_clnt_port;
};
--- 72,75 ----
Index: udpmem.cc
===================================================================
RCS file: /cvsroot/emc/rcslib/src/cms/udpmem.cc,v
retrieving revision 4.37.2.1
retrieving revision 4.37.2.2
diff -C2 -d -r4.37.2.1 -r4.37.2.2
*** udpmem.cc 22 Aug 2003 20:06:37 -0000 4.37.2.1
--- udpmem.cc 26 Aug 2003 00:39:44 -0000 4.37.2.2
***************
*** 23,26 ****
--- 23,27 ----
// FIONREAD
+ #include "msghdr.h" // struct iovec, msghdr
class UDPMEM_NONPORT_INTERNALS
|
|
From: <wsh...@us...> - 2003-08-26 00:40:00
|
Update of /cvsroot/emc/rcslib
In directory sc8-pr-cvs1:/tmp/cvs-serv4684
Modified Files:
Tag: wps_multiplat_dev_branch
Makefile.am Makefile.in configure configure.ac rcs_config.h.in
Log Message:
.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/emc/rcslib/Makefile.am,v
retrieving revision 1.7.2.9
retrieving revision 1.7.2.10
diff -C2 -d -r1.7.2.9 -r1.7.2.10
*** Makefile.am 22 Aug 2003 20:06:35 -0000 1.7.2.9
--- Makefile.am 26 Aug 2003 00:39:43 -0000 1.7.2.10
***************
*** 349,353 ****
src/cms/filemem.cc \
src/cms/cms_xml_up.cc \
- src/cms/xmlcomposespeedtest.cc\
src/node/wm_msg.cc\
src/os_intf/gtimer.cc\
--- 349,352 ----
***************
*** 399,403 ****
src/cms/tcpmem.cc \
src/cms/tcp_opts.cc \
! src/cms/tcp_svr.cc \
src/cms/sendn.c \
src/cms/recvn.c \
--- 398,402 ----
src/cms/tcpmem.cc \
src/cms/tcp_opts.cc \
! src/cms/tcp_srv.cc \
src/cms/sendn.c \
src/cms/recvn.c \
***************
*** 544,548 ****
src/java/rcsdesign/rcsdesignMainLoopInfo.java\
src/java/rcsdesign/rcsdesignModuleInfo.java\
- src/java/rcsdesign/resizingtrash.java\
src/java/rcs/update_ver\
src/java/rcs/RCS_VERSION.java.perm\
--- 543,546 ----
***************
*** 582,588 ****
src/test/ex_cfg.nml\
src/test/test.nml2\
- src/cms/cms_xml_junk.txt\
- src/cms/httpreq.txt\
- src/cms/physmem_info.txt\
src/java/diagapplet/diagappletJarInfo.txt\
src/java/diagapplet/CodeGen/CodeGenCmdLineJarInfo.txt\
--- 580,583 ----
***************
*** 591,603 ****
src/java/rcs/rcsJarInfo.txt\
src/java/rcsdesign/rcsDesignJarInfo.txt\
- src/test/rcs_out.txt\
src/update_rcs_version.sh\
- src/cms/cms_xml_testcompile_command.sh\
- src/cms/makeomac.sh\
src/test/cgtest.sh\
- src/test/debugcgtestsvr2.sh\
src/test/jtestxml.sh\
src/test/mingw_testxml.sh\
- src/test/qtest.sh\
src/test/testxml.sh\
src/test/testxmlperf.sh\
--- 586,593 ----
***************
*** 620,624 ****
etc/testnml.sh\
etc/multiplatbuild.sh\
! Makefile.am.head\
INSTALL.configure
--- 610,614 ----
etc/testnml.sh\
etc/multiplatbuild.sh\
! etc/Makefile\
INSTALL.configure
***************
*** 743,752 ****
src/test/nml_ex1.hh\
src/test/nml_test_format.hh \
- src/cms/cms_cfg_no_config.h \
src/cms/cms_xup_no_config.h \
src/cms/cmsdiag_no_config.h \
src/cms/sokintrf_no_config.h \
src/cms/nml_no_config.h \
! src/cms/tcpmem_no_config.h
!
--- 733,759 ----
src/test/nml_ex1.hh\
src/test/nml_test_format.hh \
src/cms/cms_xup_no_config.h \
+ src/cms/cms_cfg_no_config.h \
src/cms/cmsdiag_no_config.h \
src/cms/sokintrf_no_config.h \
src/cms/nml_no_config.h \
! src/cms/tcpmem_no_config.h \
! src/cms/cms_no_config.h \
! src/cms/sendn_no_config.h \
! src/cms/tcp_srv_no_config.h \
! src/cms/http_srv_no_config.h \
! src/cms/nml_srv_no_config.h \
! src/cms/physmem_no_config.h \
! src/cms/filemem_no_config.h \
! src/cms/ttyintf_no_config.h \
! src/cms/udpmem_no_config.h \
! src/cms/udp_srv_no_config.h \
! src/cms/stcpopts_no_config.h \
! src/cms/recvline_no_config.h \
! src/cms/recvmsgt_no_config.h \
! src/cms/sendmsgt_no_config.h \
! src/node/nml_mod_no_config.h \
! src/os_intf/_timer_no_config.h \
! src/os_intf/timer_no_config.h \
! src/print/rcs_prnt_no_config.h
Index: Makefile.in
===================================================================
RCS file: /cvsroot/emc/rcslib/Makefile.in,v
retrieving revision 1.7.2.9
retrieving revision 1.7.2.10
diff -C2 -d -r1.7.2.9 -r1.7.2.10
*** Makefile.in 22 Aug 2003 20:06:35 -0000 1.7.2.9
--- Makefile.in 26 Aug 2003 00:39:43 -0000 1.7.2.10
***************
*** 441,445 ****
src/cms/filemem.cc \
src/cms/cms_xml_up.cc \
- src/cms/xmlcomposespeedtest.cc\
src/node/wm_msg.cc\
src/os_intf/gtimer.cc\
--- 441,444 ----
***************
*** 491,495 ****
src/cms/tcpmem.cc \
src/cms/tcp_opts.cc \
! src/cms/tcp_svr.cc \
src/cms/sendn.c \
src/cms/recvn.c \
--- 490,494 ----
src/cms/tcpmem.cc \
src/cms/tcp_opts.cc \
! src/cms/tcp_srv.cc \
src/cms/sendn.c \
src/cms/recvn.c \
***************
*** 636,640 ****
src/java/rcsdesign/rcsdesignMainLoopInfo.java\
src/java/rcsdesign/rcsdesignModuleInfo.java\
- src/java/rcsdesign/resizingtrash.java\
src/java/rcs/update_ver\
src/java/rcs/RCS_VERSION.java.perm\
--- 635,638 ----
***************
*** 674,680 ****
src/test/ex_cfg.nml\
src/test/test.nml2\
- src/cms/cms_xml_junk.txt\
- src/cms/httpreq.txt\
- src/cms/physmem_info.txt\
src/java/diagapplet/diagappletJarInfo.txt\
src/java/diagapplet/CodeGen/CodeGenCmdLineJarInfo.txt\
--- 672,675 ----
***************
*** 683,695 ****
src/java/rcs/rcsJarInfo.txt\
src/java/rcsdesign/rcsDesignJarInfo.txt\
- src/test/rcs_out.txt\
src/update_rcs_version.sh\
- src/cms/cms_xml_testcompile_command.sh\
- src/cms/makeomac.sh\
src/test/cgtest.sh\
- src/test/debugcgtestsvr2.sh\
src/test/jtestxml.sh\
src/test/mingw_testxml.sh\
- src/test/qtest.sh\
src/test/testxml.sh\
src/test/testxmlperf.sh\
--- 678,685 ----
***************
*** 712,716 ****
etc/testnml.sh\
etc/multiplatbuild.sh\
! Makefile.am.head\
INSTALL.configure
--- 702,706 ----
etc/testnml.sh\
etc/multiplatbuild.sh\
! etc/Makefile\
INSTALL.configure
***************
*** 836,845 ****
src/test/nml_ex1.hh\
src/test/nml_test_format.hh \
- src/cms/cms_cfg_no_config.h \
src/cms/cms_xup_no_config.h \
src/cms/cmsdiag_no_config.h \
src/cms/sokintrf_no_config.h \
src/cms/nml_no_config.h \
! src/cms/tcpmem_no_config.h
subdir = .
--- 826,853 ----
src/test/nml_ex1.hh\
src/test/nml_test_format.hh \
src/cms/cms_xup_no_config.h \
+ src/cms/cms_cfg_no_config.h \
src/cms/cmsdiag_no_config.h \
src/cms/sokintrf_no_config.h \
src/cms/nml_no_config.h \
! src/cms/tcpmem_no_config.h \
! src/cms/cms_no_config.h \
! src/cms/sendn_no_config.h \
! src/cms/tcp_srv_no_config.h \
! src/cms/http_srv_no_config.h \
! src/cms/nml_srv_no_config.h \
! src/cms/physmem_no_config.h \
! src/cms/filemem_no_config.h \
! src/cms/ttyintf_no_config.h \
! src/cms/udpmem_no_config.h \
! src/cms/udp_srv_no_config.h \
! src/cms/stcpopts_no_config.h \
! src/cms/recvline_no_config.h \
! src/cms/recvmsgt_no_config.h \
! src/cms/sendmsgt_no_config.h \
! src/node/nml_mod_no_config.h \
! src/os_intf/_timer_no_config.h \
! src/os_intf/timer_no_config.h \
! src/print/rcs_prnt_no_config.h
subdir = .
Index: configure
===================================================================
RCS file: /cvsroot/emc/rcslib/configure,v
retrieving revision 1.3.2.6
retrieving revision 1.3.2.7
diff -C2 -d -r1.3.2.6 -r1.3.2.7
*** configure 22 Aug 2003 20:06:35 -0000 1.3.2.6
--- configure 26 Aug 2003 00:39:43 -0000 1.3.2.7
***************
*** 1009,1014 ****
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
! --enable-ALL Enable/Disable all of the above in one command.
! (default=no)
--enable-nml-codegen Build the nml_codegen tool also enables
librcsforgcj. It requires GCJ.(default=no)
--- 1009,1016 ----
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
! --enable-ALL Enable/Disable all the other features in one
! command. (default=no)
! --enable-ALLJAVA Enable/Disable all java releted features of the
! above in one command. (default=no)
--enable-nml-codegen Build the nml_codegen tool also enables
librcsforgcj. It requires GCJ.(default=no)
***************
*** 1940,1947 ****
if test "${enable_ALL+set}" = set; then
enableval="$enable_ALL"
! enable_nml_codegen=${enableval};enable_rcs_jar=${enableval};enable_codegen_jar=${enableval};enable_diagapplet_jar=${enableval};enable_filemem=${enableval};enable_xml=${enableval};enable_xdr=${enableval};enable_disp=${enableval};enable_diag=${enableval};enable_print=${enableval};enable_nmlqr=${enableval};enable_xsd2nmlh=${enableval};enable_locmem=${enableval};enable_phantom=${enableval};enable_shmem=${enableval};enable_stcp=${enableval};enable_tcp=${enableval};enable_udp=${enableval};enable_tty=${enableval};enable_crypt=${enableval};enable_http=${enableval};enable_posemath_in_rcslib=${enableval};enable_nmlmod_in_rcslib=${enableval};enable_server=${enableval};enable_sokintrf=${enable_val};enable_rtlmem=${enableval}
fi;
# Check whether --enable-nml_codegen or --disable-nml_codegen was given.
if test "${enable_nml_codegen+set}" = set; then
--- 1942,1955 ----
if test "${enable_ALL+set}" = set; then
enableval="$enable_ALL"
! enable_nml_codegen=${enableval};enable_rcs_jar=${enableval};enable_codegen_jar=${enableval};enable_diagapplet_jar=${enableval};enable_filemem=${enableval};enable_xml=${enableval};enable_xdr=${enableval};enable_disp=${enableval};enable_diag=${enableval};enable_print=${enableval};enable_nmlqr=${enableval};enable_xsd2nmlh=${enableval};enable_locmem=${enableval};enable_phantom=${enableval};enable_shmem=${enableval};enable_stcp=${enableval};enable_tcp=${enableval};enable_udp=${enableval};enable_tty=${enableval};enable_crypt=${enableval};enable_http=${enableval};enable_posemath_in_rcslib=${enableval};enable_nmlmod_in_rcslib=${enableval};enable_server=${enableval};enable_sokintrf=${enableval};enable_rtlmem=${enableval}
fi;
+ # Check whether --enable-ALLJAVA or --disable-ALLJAVA was given.
+ if test "${enable_ALLJAVA+set}" = set; then
+ enableval="$enable_ALLJAVA"
+ enable_nml_codegen=${enableval};enable_rcs_jar=${enableval};enable_codegen_jar=${enableval};enable_diagapplet_jar=${enableval};enable_nml_codegen=${enableval}
+ fi;
+
# Check whether --enable-nml_codegen or --disable-nml_codegen was given.
if test "${enable_nml_codegen+set}" = set; then
***************
*** 2199,2204 ****
enableval="$enable_sokintrf"
enable_sokintrf=$enableval;
! { echo "$as_me:$LINENO: enable_sokintrf=$enableval" >&5
! echo "$as_me: enable_sokintrf=$enableval" >&6;}
else
enable_sokintrf=yes
--- 2207,2212 ----
enableval="$enable_sokintrf"
enable_sokintrf=$enableval;
! { echo "$as_me:$LINENO: enable_sokintrf=${enableval}" >&5
! echo "$as_me: enable_sokintrf=${enableval}" >&6;}
else
enable_sokintrf=yes
***************
*** 5172,5176 ****
*-*-irix6*)
# Find out which ABI we are using.
! echo '#line 5174 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
--- 5180,5184 ----
*-*-irix6*)
# Find out which ABI we are using.
! echo '#line 5182 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
***************
*** 5708,5712 ****
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
! if { (eval echo configure:5710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
--- 5716,5720 ----
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
! if { (eval echo configure:5718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
***************
*** 7501,7505 ****
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
! #line 7503 "configure"
#include "confdefs.h"
--- 7509,7513 ----
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
! #line 7511 "configure"
#include "confdefs.h"
***************
*** 7599,7603 ****
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
! #line 7601 "configure"
#include "confdefs.h"
--- 7607,7611 ----
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
! #line 7609 "configure"
#include "confdefs.h"
***************
*** 9921,9925 ****
! for ac_header in errno.h ctype.h arpa/inet.h fcntl.h netdb.h netinet/in.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/utsname.h sys/systeminfo.h sys/time.h syslog.h termios.h unistd.h semaphore.h sys/filio.h math.h signal.h dirent.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
--- 9929,9935 ----
!
!
! for ac_header in errno.h ctype.h arpa/inet.h fcntl.h netdb.h netinet/in.h sys/file.h sys/ioctl.h sys/param.h sys/uio.h net/uio.h sys/socket.h sys/utsname.h sys/systeminfo.h sys/time.h syslog.h termios.h unistd.h semaphore.h sys/filio.h math.h signal.h dirent.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
***************
*** 10041,10046 ****
!
! for ac_header in sys/ipc.h sys/sem.h sys/fcntl.h sys/stat.h sys/wait.h sys/mman.h sys/shm.h sys/sysinfo.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
--- 10051,10055 ----
! for ac_header in sys/ipc.h sys/sem.h sys/fcntl.h sys/stat.h sys/mman.h sys/shm.h sys/sysinfo.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
***************
*** 12041,12044 ****
--- 12050,12055 ----
fi
+
+
echo "$as_me:$LINENO: checking for caddr_t" >&5
echo $ECHO_N "checking for caddr_t... $ECHO_C" >&6
***************
*** 12049,12053 ****
#line $LINENO "configure"
#include "confdefs.h"
! $ac_includes_default
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
--- 12060,12116 ----
#line $LINENO "configure"
#include "confdefs.h"
!
! #if HAVE_SYS_TYPES_H
! # include <sys/types.h>
! #endif
! #if HAVE_SYS_STAT_H
! # include <sys/stat.h>
! #endif
! #if STDC_HEADERS
! # include <stdlib.h>
! # include <stddef.h>
! #else
! # if HAVE_STDLIB_H
! # include <stdlib.h>
! # endif
! #endif
! #if HAVE_STRING_H
! # if !STDC_HEADERS && HAVE_MEMORY_H
! # include <memory.h>
! # endif
! # include <string.h>
! #endif
! #if HAVE_STRINGS_H
! # include <strings.h>
! #endif
! #if HAVE_INTTYPES_H
! # include <inttypes.h>
! #else
! # if HAVE_STDINT_H
! # include <stdint.h>
! # endif
! #endif
! #if HAVE_UNISTD_H
! # include <unistd.h>
! #endif
! #if HAVE_SYS_UIO_H
! # include <sys/uio.h>
! #else
! #if HAVE_NET_UIO_H
! # include <net/uio.h>
! #endif
! #endif
! #if HAVE_SYS_SOCKET_H
! #include <sys/socket.h>
! #endif
! #if HAVE_WINSOCK2_H
! #include <winsock2.h>
! #endif
! #if HAVE_WINDOWS_H
! #include <windows.h>
! #endif
!
!
!
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
***************
*** 12089,12092 ****
--- 12152,12382 ----
echo "$as_me:$LINENO: result: $ac_cv_type_caddr_t" >&5
echo "${ECHO_T}$ac_cv_type_caddr_t" >&6
+ if test $ac_cv_type_caddr_t = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_CADDR_T_TYPE 1
+ _ACEOF
+
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking for struct iovec" >&5
+ echo $ECHO_N "checking for struct iovec... $ECHO_C" >&6
+ if test "${ac_cv_type_struct_iovec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_STAT_H
+ # include <sys/stat.h>
+ #endif
+ #if STDC_HEADERS
+ # include <stdlib.h>
+ # include <stddef.h>
+ #else
+ # if HAVE_STDLIB_H
+ # include <stdlib.h>
+ # endif
+ #endif
+ #if HAVE_STRING_H
+ # if !STDC_HEADERS && HAVE_MEMORY_H
+ # include <memory.h>
+ # endif
+ # include <string.h>
+ #endif
+ #if HAVE_STRINGS_H
+ # include <strings.h>
+ #endif
+ #if HAVE_INTTYPES_H
+ # include <inttypes.h>
+ #else
+ # if HAVE_STDINT_H
+ # include <stdint.h>
+ # endif
+ #endif
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ #if HAVE_SYS_UIO_H
+ # include <sys/uio.h>
+ #else
+ #if HAVE_NET_UIO_H
+ # include <net/uio.h>
+ #endif
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #if HAVE_WINSOCK2_H
+ #include <winsock2.h>
+ #endif
+ #if HAVE_WINDOWS_H
+ #include <windows.h>
+ #endif
+
+
+
+ #ifdef F77_DUMMY_MAIN
+ # ifdef __cplusplus
+ extern "C"
+ # endif
+ int F77_DUMMY_MAIN() { return 1; }
+ #endif
+ int
+ main ()
+ {
+ if ((struct iovec *) 0)
+ return 0;
+ if (sizeof (struct iovec))
+ return 0;
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_struct_iovec=yes
+ else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_type_struct_iovec=no
+ fi
+ rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_struct_iovec" >&5
+ echo "${ECHO_T}$ac_cv_type_struct_iovec" >&6
+ if test $ac_cv_type_struct_iovec = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_STRUCT_IOVEC_TYPE 1
+ _ACEOF
+
+ fi
+
+
+ echo "$as_me:$LINENO: checking for struct msghdr" >&5
+ echo $ECHO_N "checking for struct msghdr... $ECHO_C" >&6
+ if test "${ac_cv_type_struct_msghdr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #if HAVE_SYS_STAT_H
+ # include <sys/stat.h>
+ #endif
+ #if STDC_HEADERS
+ # include <stdlib.h>
+ # include <stddef.h>
+ #else
+ # if HAVE_STDLIB_H
+ # include <stdlib.h>
+ # endif
+ #endif
+ #if HAVE_STRING_H
+ # if !STDC_HEADERS && HAVE_MEMORY_H
+ # include <memory.h>
+ # endif
+ # include <string.h>
+ #endif
+ #if HAVE_STRINGS_H
+ # include <strings.h>
+ #endif
+ #if HAVE_INTTYPES_H
+ # include <inttypes.h>
+ #else
+ # if HAVE_STDINT_H
+ # include <stdint.h>
+ # endif
+ #endif
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ #if HAVE_SYS_UIO_H
+ # include <sys/uio.h>
+ #else
+ #if HAVE_NET_UIO_H
+ # include <net/uio.h>
+ #endif
+ #endif
+ #if HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+ #if HAVE_WINSOCK2_H
+ #include <winsock2.h>
+ #endif
+ #if HAVE_WINDOWS_H
+ #include <windows.h>
+ #endif
+
+
+
+ #ifdef F77_DUMMY_MAIN
+ # ifdef __cplusplus
+ extern "C"
+ # endif
+ int F77_DUMMY_MAIN() { return 1; }
+ #endif
+ int
+ main ()
+ {
+ if ((struct msghdr *) 0)
+ return 0;
+ if (sizeof (struct msghdr))
+ return 0;
+ ;
+ return 0;
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_struct_msghdr=yes
+ else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_type_struct_msghdr=no
+ fi
+ rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_struct_msghdr" >&5
+ echo "${ECHO_T}$ac_cv_type_struct_msghdr" >&6
+ if test $ac_cv_type_struct_msghdr = yes; then
+
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_STRUCT_MSGHDR_TYPE 1
+ _ACEOF
+
+ fi
+
***************
*** 12095,12098 ****
--- 12385,12389 ----
if test "x${check_for_windows_stuff}" = "xyes" ; then
+
echo "$as_me:$LINENO: checking for u_int" >&5
echo $ECHO_N "checking for u_int... $ECHO_C" >&6
***************
*** 12155,12158 ****
--- 12446,12450 ----
fi
+
if test "x${ac_cv_have_u_int}" = "xyes" ; then
***************
*** 12163,12167 ****
fi
-
echo "$as_me:$LINENO: checking for u_short" >&5
echo $ECHO_N "checking for u_short... $ECHO_C" >&6
--- 12455,12458 ----
***************
*** 12221,12225 ****
ac_cv_have_u_short=yes
else
! ac_cv_have_u_short=yes
fi
--- 12512,12516 ----
ac_cv_have_u_short=yes
else
! ac_cv_have_u_short=no
fi
***************
*** 12291,12295 ****
ac_cv_have_u_long=yes
else
! ac_cv_have_u_long=yes
fi
--- 12582,12586 ----
ac_cv_have_u_long=yes
else
! ac_cv_have_u_long=no
fi
Index: configure.ac
===================================================================
RCS file: /cvsroot/emc/rcslib/configure.ac,v
retrieving revision 1.3.2.5
retrieving revision 1.3.2.6
diff -C2 -d -r1.3.2.5 -r1.3.2.6
*** configure.ac 22 Aug 2003 20:06:36 -0000 1.3.2.5
--- configure.ac 26 Aug 2003 00:39:43 -0000 1.3.2.6
***************
*** 60,66 ****
AC_ARG_ENABLE(ALL,
[AC_HELP_STRING([--enable-ALL],
! [Enable/Disable all of the above in one command. (default=no)])],
! [enable_nml_codegen=${enableval};enable_rcs_jar=${enableval};enable_codegen_jar=${enableval};enable_diagapplet_jar=${enableval};enable_filemem=${enableval};enable_xml=${enableval};enable_xdr=${enableval};enable_disp=${enableval};enable_diag=${enableval};enable_print=${enableval};enable_nmlqr=${enableval};enable_xsd2nmlh=${enableval};enable_locmem=${enableval};enable_phantom=${enableval};enable_shmem=${enableval};enable_stcp=${enableval};enable_tcp=${enableval};enable_udp=${enableval};enable_tty=${enableval};enable_crypt=${enableval};enable_http=${enableval};enable_posemath_in_rcslib=${enableval};enable_nmlmod_in_rcslib=${enableval};enable_server=${enableval};enable_sokintrf=${enable_val};enable_rtlmem=${enableval}])
AC_ARG_ENABLE(nml_codegen,
--- 60,71 ----
AC_ARG_ENABLE(ALL,
[AC_HELP_STRING([--enable-ALL],
! [Enable/Disable all the other features in one command. (default=no)])],
! [enable_nml_codegen=${enableval};enable_rcs_jar=${enableval};enable_codegen_jar=${enableval};enable_diagapplet_jar=${enableval};enable_filemem=${enableval};enable_xml=${enableval};enable_xdr=${enableval};enable_disp=${enableval};enable_diag=${enableval};enable_print=${enableval};enable_nmlqr=${enableval};enable_xsd2nmlh=${enableval};enable_locmem=${enableval};enable_phantom=${enableval};enable_shmem=${enableval};enable_stcp=${enableval};enable_tcp=${enableval};enable_udp=${enableval};enable_tty=${enableval};enable_crypt=${enableval};enable_http=${enableval};enable_posemath_in_rcslib=${enableval};enable_nmlmod_in_rcslib=${enableval};enable_server=${enableval};enable_sokintrf=${enableval};enable_rtlmem=${enableval}])
!
+ AC_ARG_ENABLE(ALLJAVA,
+ [AC_HELP_STRING([--enable-ALLJAVA],
+ [Enable/Disable all java releted features of the above in one command. (default=no)])],
+ [enable_nml_codegen=${enableval};enable_rcs_jar=${enableval};enable_codegen_jar=${enableval};enable_diagapplet_jar=${enableval};enable_nml_codegen=${enableval}])
AC_ARG_ENABLE(nml_codegen,
***************
*** 253,257 ****
[Add some simple socket support support, needed for TCP,UDP,HTTP etc. (default=yes)])],
[enable_sokintrf=$enableval;
! AC_MSG_NOTICE([enable_sokintrf=$enableval])],
[enable_sokintrf=yes])
--- 258,262 ----
[Add some simple socket support support, needed for TCP,UDP,HTTP etc. (default=yes)])],
[enable_sokintrf=$enableval;
! AC_MSG_NOTICE([enable_sokintrf=${enableval}])],
[enable_sokintrf=yes])
***************
*** 610,615 ****
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
! AC_CHECK_HEADERS([errno.h ctype.h arpa/inet.h fcntl.h netdb.h netinet/in.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/utsname.h sys/systeminfo.h sys/time.h syslog.h termios.h unistd.h semaphore.h sys/filio.h math.h signal.h dirent.h])
! AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/fcntl.h sys/stat.h sys/wait.h sys/mman.h sys/shm.h sys/sysinfo.h])
AC_CHECK_HEADERS(standards.h sys/xti.h)
--- 615,620 ----
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
! AC_CHECK_HEADERS([errno.h ctype.h arpa/inet.h fcntl.h netdb.h netinet/in.h sys/file.h sys/ioctl.h sys/param.h sys/uio.h net/uio.h sys/socket.h sys/utsname.h sys/systeminfo.h sys/time.h syslog.h termios.h unistd.h semaphore.h sys/filio.h math.h signal.h dirent.h])
! AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/fcntl.h sys/stat.h sys/mman.h sys/shm.h sys/sysinfo.h])
AC_CHECK_HEADERS(standards.h sys/xti.h)
***************
*** 843,847 ****
AC_STRUCT_TM
AC_TYPE_UID_T
! AC_CHECK_TYPE([caddr_t])
## AC_MSG_NOTICE([LIBS=${LIBS}])
--- 848,1019 ----
AC_STRUCT_TM
AC_TYPE_UID_T
!
!
! AC_CHECK_TYPE([caddr_t],
! [AC_DEFINE(HAVE_CADDR_T_TYPE,1,[Define to 1 if you have the caddr_t type.])],,
! [
! #if HAVE_SYS_TYPES_H
! # include <sys/types.h>
! #endif
! #if HAVE_SYS_STAT_H
! # include <sys/stat.h>
! #endif
! #if STDC_HEADERS
! # include <stdlib.h>
! # include <stddef.h>
! #else
! # if HAVE_STDLIB_H
! # include <stdlib.h>
! # endif
! #endif
! #if HAVE_STRING_H
! # if !STDC_HEADERS && HAVE_MEMORY_H
! # include <memory.h>
! # endif
! # include <string.h>
! #endif
! #if HAVE_STRINGS_H
! # include <strings.h>
! #endif
! #if HAVE_INTTYPES_H
! # include <inttypes.h>
! #else
! # if HAVE_STDINT_H
! # include <stdint.h>
! # endif
! #endif
! #if HAVE_UNISTD_H
! # include <unistd.h>
! #endif
! #if HAVE_SYS_UIO_H
! # include <sys/uio.h>
! #else
! #if HAVE_NET_UIO_H
! # include <net/uio.h>
! #endif
! #endif
! #if HAVE_SYS_SOCKET_H
! #include <sys/socket.h>
! #endif
! #if HAVE_WINSOCK2_H
! #include <winsock2.h>
! #endif
! #if HAVE_WINDOWS_H
! #include <windows.h>
! #endif
! ]
! )
!
!
! AC_CHECK_TYPE([struct iovec],
! [AC_DEFINE(HAVE_STRUCT_IOVEC_TYPE,1,[Define to 1 if you have the struct iovec type.])],,
! [
! #if HAVE_SYS_TYPES_H
! # include <sys/types.h>
! #endif
! #if HAVE_SYS_STAT_H
! # include <sys/stat.h>
! #endif
! #if STDC_HEADERS
! # include <stdlib.h>
! # include <stddef.h>
! #else
! # if HAVE_STDLIB_H
! # include <stdlib.h>
! # endif
! #endif
! #if HAVE_STRING_H
! # if !STDC_HEADERS && HAVE_MEMORY_H
! # include <memory.h>
! # endif
! # include <string.h>
! #endif
! #if HAVE_STRINGS_H
! # include <strings.h>
! #endif
! #if HAVE_INTTYPES_H
! # include <inttypes.h>
! #else
! # if HAVE_STDINT_H
! # include <stdint.h>
! # endif
! #endif
! #if HAVE_UNISTD_H
! # include <unistd.h>
! #endif
! #if HAVE_SYS_UIO_H
! # include <sys/uio.h>
! #else
! #if HAVE_NET_UIO_H
! # include <net/uio.h>
! #endif
! #endif
! #if HAVE_SYS_SOCKET_H
! #include <sys/socket.h>
! #endif
! #if HAVE_WINSOCK2_H
! #include <winsock2.h>
! #endif
! #if HAVE_WINDOWS_H
! #include <windows.h>
! #endif
! ]
! )
!
! AC_CHECK_TYPE([struct msghdr],
! [AC_DEFINE(HAVE_STRUCT_MSGHDR_TYPE,1,[Define to 1 if you have the struct msghdr type.])],,
! [
! #if HAVE_SYS_TYPES_H
! # include <sys/types.h>
! #endif
! #if HAVE_SYS_STAT_H
! # include <sys/stat.h>
! #endif
! #if STDC_HEADERS
! # include <stdlib.h>
! # include <stddef.h>
! #else
! # if HAVE_STDLIB_H
! # include <stdlib.h>
! # endif
! #endif
! #if HAVE_STRING_H
! # if !STDC_HEADERS && HAVE_MEMORY_H
! # include <memory.h>
! # endif
! # include <string.h>
! #endif
! #if HAVE_STRINGS_H
! # include <strings.h>
! #endif
! #if HAVE_INTTYPES_H
! # include <inttypes.h>
! #else
! # if HAVE_STDINT_H
! # include <stdint.h>
! # endif
! #endif
! #if HAVE_UNISTD_H
! # include <unistd.h>
! #endif
! #if HAVE_SYS_UIO_H
! # include <sys/uio.h>
! #else
! #if HAVE_NET_UIO_H
! # include <net/uio.h>
! #endif
! #endif
! #if HAVE_SYS_SOCKET_H
! #include <sys/socket.h>
! #endif
! #if HAVE_WINSOCK2_H
! #include <winsock2.h>
! #endif
! #if HAVE_WINDOWS_H
! #include <windows.h>
! #endif
! ]
! )
!
## AC_MSG_NOTICE([LIBS=${LIBS}])
***************
*** 849,852 ****
--- 1021,1025 ----
if test "x${check_for_windows_stuff}" = "xyes" ; then
+
AC_CHECK_TYPE([u_int],
[ac_cv_have_u_int=yes],
***************
*** 858,869 ****
#endif
])
if test "x${ac_cv_have_u_int}" = "xyes" ; then
AC_DEFINE(HAVE_U_INT,1,[Define to 1 if you have the u_int type])
fi
-
AC_CHECK_TYPE([u_short],
[ac_cv_have_u_short=yes],
! [ac_cv_have_u_short=yes],
[
#include <windows.h>
--- 1031,1042 ----
#endif
])
+
if test "x${ac_cv_have_u_int}" = "xyes" ; then
AC_DEFINE(HAVE_U_INT,1,[Define to 1 if you have the u_int type])
fi
AC_CHECK_TYPE([u_short],
[ac_cv_have_u_short=yes],
! [ac_cv_have_u_short=no],
[
#include <windows.h>
***************
*** 880,884 ****
AC_CHECK_TYPE([u_long],
[ac_cv_have_u_long=yes],
! [ac_cv_have_u_long=yes],
[
#include <windows.h>
--- 1053,1057 ----
AC_CHECK_TYPE([u_long],
[ac_cv_have_u_long=yes],
! [ac_cv_have_u_long=no],
[
#include <windows.h>
Index: rcs_config.h.in
===================================================================
RCS file: /cvsroot/emc/rcslib/rcs_config.h.in,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** rcs_config.h.in 22 Aug 2003 03:34:26 -0000 1.1.2.5
--- rcs_config.h.in 26 Aug 2003 00:39:43 -0000 1.1.2.6
***************
*** 7,10 ****
--- 7,13 ----
#undef HAVE_ARPA_INET_H
+ /* Define to 1 if you have the caddr_t type. */
+ #undef HAVE_CADDR_T_TYPE
+
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
***************
*** 109,112 ****
--- 112,118 ----
#undef HAVE_NETINET_TCP_H
+ /* Define to 1 if you have the <net/uio.h> header file. */
+ #undef HAVE_NET_UIO_H
+
/* Define to 1 if you have the `opendir' function. */
#undef HAVE_OPENDIR
***************
*** 220,223 ****
--- 226,235 ----
#undef HAVE_STRTOUL
+ /* Define to 1 if you have the struct iovec type. */
+ #undef HAVE_STRUCT_IOVEC_TYPE
+
+ /* Define to 1 if you have the struct msghdr type. */
+ #undef HAVE_STRUCT_MSGHDR_TYPE
+
/* Define to 1 if you have the `sysconf' function. */
#undef HAVE_SYSCONF
***************
*** 282,289 ****
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
! /* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
--- 294,304 ----
#undef HAVE_SYS_TYPES_H
+ /* Define to 1 if you have the <sys/uio.h> header file. */
+ #undef HAVE_SYS_UIO_H
+
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
! /* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H
|
|
From: <wsh...@us...> - 2003-08-26 00:39:57
|
Update of /cvsroot/emc/rcslib/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4684/src
Modified Files:
Tag: wps_multiplat_dev_branch
rcs_config_include.h
Log Message:
.
Index: rcs_config_include.h
===================================================================
RCS file: /cvsroot/emc/rcslib/src/rcs_config_include.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** rcs_config_include.h 22 Aug 2003 03:34:26 -0000 1.1.2.3
--- rcs_config_include.h 26 Aug 2003 00:39:44 -0000 1.1.2.4
***************
*** 96,99 ****
--- 96,107 ----
#endif
+ #if HAVE_SYS_UIO_H
+ # include <sys/uio.h>
+ #else
+ #if HAVE_NET_UIO_H
+ # include <net/uio.h>
+ #endif
+ #endif
+
#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
|
|
From: <wsh...@us...> - 2003-08-26 00:39:57
|
Update of /cvsroot/emc/rcslib/src/nt_xdr
In directory sc8-pr-cvs1:/tmp/cvs-serv4684/src/nt_xdr
Modified Files:
Tag: wps_multiplat_dev_branch
xdr.h xdr_rec.c xdrtypes.h
Log Message:
.
Index: xdr.h
===================================================================
RCS file: /cvsroot/emc/rcslib/src/nt_xdr/xdr.h,v
retrieving revision 4.33.2.1
retrieving revision 4.33.2.2
diff -C2 -d -r4.33.2.1 -r4.33.2.2
*** xdr.h 21 Aug 2003 20:24:15 -0000 4.33.2.1
--- xdr.h 26 Aug 2003 00:39:44 -0000 4.33.2.2
***************
*** 54,57 ****
--- 54,60 ----
#endif
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
// The file was originally types.h but I changed the name to
***************
*** 353,356 ****
--- 356,363 ----
extern bool_t xdrrec_skiprecord(); /* move to beginning of next record */
extern bool_t xdrrec_eof(); /* true if no more input */
+
+ #ifdef __cplusplus
+ }
+ #endif
#endif /* __XDR_HEADER__ */
Index: xdr_rec.c
===================================================================
RCS file: /cvsroot/emc/rcslib/src/nt_xdr/xdr_rec.c,v
retrieving revision 4.32.2.2
retrieving revision 4.32.2.3
diff -C2 -d -r4.32.2.2 -r4.32.2.3
*** xdr_rec.c 22 Aug 2003 03:34:27 -0000 4.32.2.2
--- xdr_rec.c 26 Aug 2003 00:39:44 -0000 4.32.2.3
***************
*** 136,139 ****
--- 136,144 ----
} RECSTREAM;
+ static bool_t flush_out(register RECSTREAM *rstrm, bool_t eor);
+ static bool_t get_input_bytes(register RECSTREAM *rstrm,register caddr_t addr,register int len);
+ static bool_t set_input_fragment(register RECSTREAM *rstrm);
+ static bool_t skip_input_bytes(register RECSTREAM *rstrm,long cnt);
+
/*
***************
*** 502,508 ****
*/
static bool_t
! flush_out(rstrm, eor)
! register RECSTREAM *rstrm;
! bool_t eor;
{
register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
--- 507,512 ----
*/
static bool_t
! flush_out(register RECSTREAM *rstrm,
! bool_t eor)
{
register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
***************
*** 540,548 ****
}
! static bool_t /* knows nothing about records! Only about input buffers */
! get_input_bytes(rstrm, addr, len)
! register RECSTREAM *rstrm;
! register caddr_t addr;
! register int len;
{
register int current;
--- 544,553 ----
}
! /* knows nothing about records! Only about input buffers */
! static bool_t
! get_input_bytes(
! register RECSTREAM *rstrm,
! register caddr_t addr,
! register int len)
{
register int current;
***************
*** 564,570 ****
}
! static bool_t /* next two bytes of the input stream are treated as a header */
! set_input_fragment(rstrm)
! register RECSTREAM *rstrm;
{
u_long header;
--- 569,576 ----
}
! /* next two bytes of the input stream are treated as a header */
! static bool_t
! set_input_fragment(
! register RECSTREAM *rstrm)
{
u_long header;
***************
*** 578,585 ****
}
! static bool_t /* consumes input bytes; knows nothing about records! */
! skip_input_bytes(rstrm, cnt)
! register RECSTREAM *rstrm;
! long cnt;
{
register int current;
--- 584,590 ----
}
! /* consumes input bytes; knows nothing about records! */
! static bool_t
! skip_input_bytes(register RECSTREAM *rstrm,long cnt)
{
register int current;
Index: xdrtypes.h
===================================================================
RCS file: /cvsroot/emc/rcslib/src/nt_xdr/xdrtypes.h,v
retrieving revision 4.33.2.1
retrieving revision 4.33.2.2
diff -C2 -d -r4.33.2.1 -r4.33.2.2
*** xdrtypes.h 21 Aug 2003 20:24:15 -0000 4.33.2.1
--- xdrtypes.h 26 Aug 2003 00:39:44 -0000 4.33.2.2
***************
*** 90,95 ****
#endif
! #ifndef HAVE__CADDR_T
typedef char *caddr_t;
#endif
#ifndef mingw32
--- 90,96 ----
#endif
! #if !defined(HAVE_CADDR_T_TYPE) && !defined(CADDR_T_DEFINED) && !defined(HAVE__CADDR_T)
typedef char *caddr_t;
+ #define CADDR_T_DEFINED
#endif
#ifndef mingw32
|
|
From: <wsh...@us...> - 2003-08-26 00:39:57
|
Update of /cvsroot/emc/rcslib/etc
In directory sc8-pr-cvs1:/tmp/cvs-serv4684/etc
Modified Files:
Tag: wps_multiplat_dev_branch
multiplatbuild.sh testnml_internal.sh
Log Message:
.
Index: multiplatbuild.sh
===================================================================
RCS file: /cvsroot/emc/rcslib/etc/Attic/multiplatbuild.sh,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** multiplatbuild.sh 22 Aug 2003 20:06:36 -0000 1.1.2.4
--- multiplatbuild.sh 26 Aug 2003 00:39:44 -0000 1.1.2.5
***************
*** 342,346 ****
if test ! -f Makefile -a "xdistclean" != "x${1}" ; then
! ${rcsdir}/configure --prefix=${install_dir} || exit 127
fi
if test -f Makefile ; then
--- 342,346 ----
if test ! -f Makefile -a "xdistclean" != "x${1}" ; then
! ${rcsdir}/configure --prefix=${install_dir} ${host_arg_to_add} || exit 127
fi
if test -f Makefile ; then
Index: testnml_internal.sh
===================================================================
RCS file: /cvsroot/emc/rcslib/etc/testnml_internal.sh,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** testnml_internal.sh 19 Jun 2003 15:39:58 -0000 1.2
--- testnml_internal.sh 26 Aug 2003 00:39:44 -0000 1.2.2.1
***************
*** 11,20 ****
echo "PRINTENV"
printenv
! builddir=.
if test '!' -x "${builddir}/nmlclean" -a '!' -x "${builddir}/nmlcfg" -a '!' -x "${builddir}/nml_test_server" ; then
if test -x './=build/nmlclean' -a -x './=build/nmlcfg' -a -x './=build/nml_test_server' ; then
! builddir='./=build';
echo "build directory set to:"
echo ${builddir}
--- 11,21 ----
echo "PRINTENV"
printenv
+ printenv >&2
! builddir=`pwd`
if test '!' -x "${builddir}/nmlclean" -a '!' -x "${builddir}/nmlcfg" -a '!' -x "${builddir}/nml_test_server" ; then
if test -x './=build/nmlclean' -a -x './=build/nmlcfg' -a -x './=build/nml_test_server' ; then
! builddir=`pwd`'/=build';
echo "build directory set to:"
echo ${builddir}
***************
*** 59,65 ****
fi
echo "Testing nmlcfg . . ."
! ${builddir}/nmlcfg ${srcdir}/src/test/test.nml2 -o /tmp/test.nml
if test $? -ne 0 ; then
echo "nmlcfg test failed"
--- 60,79 ----
fi
+ ls -l
+ ls -l >&2
+
+ echo "Current directory:"
+ pwd
+ pwd >&2
+
+ echo PROGRAM_LAUNCHER=${PROGRAM_LAUNCHER}
+ echo EXEEXT=${EXEEXT}
+ echo KILL_LAUNCHER=${KILL_LAUNCHER}
+
echo "Testing nmlcfg . . ."
! ${KILL_LAUNCHER}
!
! ${PROGRAM_LAUNCHER} ${builddir}/nmlcfg${EXEEXT} ${srcdir}/src/test/test.nml2 -o /tmp/test.nml
if test $? -ne 0 ; then
echo "nmlcfg test failed"
***************
*** 74,84 ****
echo "nmlcfg test Passed"
echo "Starting server . . ."
! ${builddir}/nml_test_server b1 b1s /tmp/test.nml &
sleep 5
echo "Testing local write . . . "
! ${builddir}/nml_test_write b1 lw /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Local write test failed."
--- 88,100 ----
echo "nmlcfg test Passed"
+ ${KILL_LAUNCHER}
+
echo "Starting server . . ."
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_server${EXEEXT} b1 b1s /tmp/test.nml &
sleep 5
echo "Testing local write . . . "
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_write${EXEEXT} b1 lw /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Local write test failed."
***************
*** 101,105 ****
echo "Testing local read . . . "
! ${builddir}/nml_test_read b1 lr /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Local read test failed."
--- 117,121 ----
echo "Testing local read . . . "
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_read${EXEEXT} b1 lr /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Local read test failed."
***************
*** 136,154 ****
fi
echo "Starting server . . ."
! ${builddir}/nml_test_server b1 b1s /tmp/test.nml &
sleep 5
! ( sleep 5 ; ${builddir}/nml_test_write b1 lw /tmp/test.nml 8; \
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 \
) &
echo "Testing local blocking read . . . "
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 &
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 &
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 &
sleep 1
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 &
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8
if test $? -ne 0 ; then
echo "Local blocking read test failed."
--- 152,173 ----
fi
+ ${KILL_LAUNCHER}
+
echo "Starting server . . ."
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_server${EXEEXT} b1 b1s /tmp/test.nml &
sleep 5
! ( sleep 5 ; ${PROGRAM_LAUNCHER} ${builddir}/nml_test_write${EXEEXT} b1 lw /tmp/test.nml 8; \
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 \
) &
echo "Testing local blocking read . . . "
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 &
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 &
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 &
sleep 1
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 &
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8
!
if test $? -ne 0 ; then
echo "Local blocking read test failed."
***************
*** 171,175 ****
echo "Testing remote write . . . "
! ${builddir}/nml_test_write b1 rw /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Remote write test failed."
--- 190,194 ----
echo "Testing remote write . . . "
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_write${EXEEXT} b1 rw /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Remote write test failed."
***************
*** 192,196 ****
echo "Testing remote read . . . "
! ${builddir}/nml_test_read b1 rr /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Remote write read failed."
--- 211,215 ----
echo "Testing remote read . . . "
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_read${EXEEXT} b1 rr /tmp/test.nml 7
if test $? -ne 0 ; then
echo "Remote write read failed."
***************
*** 212,215 ****
--- 231,236 ----
+ ${KILL_LAUNCHER}
+
echo "Kill any nml test programs still running."
procstokill=`ps -ae | grep nml_te | awk '{print $1}'`
***************
*** 227,245 ****
echo "Starting server . . ."
! ${builddir}/nml_test_server b1 b1s /tmp/test.nml &
sleep 5
! ( sleep 5 ; ${builddir}/nml_test_write b1 rw /tmp/test.nml 8 ; \
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 ) &
echo "Testing remote blocking read . . . "
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 &
! ${builddir}/nml_test_blocking_read b1 rr /tmp/test.nml 30 8 &
! ${builddir}/nml_test_blocking_read b1 rr /tmp/test.nml 30 8 &
sleep 1
! ${builddir}/nml_test_blocking_read b1 lr /tmp/test.nml 30 8 &
date
echo '$?=' $?
! ${builddir}/nml_test_blocking_read b1 rr /tmp/test.nml -1 8
echo '$?=' $?
if test $? -ne 0 ; then
--- 248,266 ----
echo "Starting server . . ."
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_server${EXEEXT} b1 b1s /tmp/test.nml &
sleep 5
! ( sleep 5 ; ${PROGRAM_LAUNCHER} ${builddir}/nml_test_write${EXEEXT} b1 rw /tmp/test.nml 8 ; \
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 ) &
echo "Testing remote blocking read . . . "
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 &
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 rr /tmp/test.nml 30 8 &
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 rr /tmp/test.nml 30 8 &
sleep 1
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 lr /tmp/test.nml 30 8 &
date
echo '$?=' $?
! ${PROGRAM_LAUNCHER} ${builddir}/nml_test_blocking_read${EXEEXT} b1 rr /tmp/test.nml -1 8
echo '$?=' $?
if test $? -ne 0 ; then
***************
*** 277,281 ****
fi
! ${builddir}/nmlclean /tmp/test.nml
if test -f nmlclean.log ; then
mv nmlclean.log /tmp/nmlclean-1-$$.log
--- 298,304 ----
fi
! ${KILL_LAUNCHER}
!
! ${PROGRAM_LAUNCHER} ${builddir}/nmlclean${EXEEXT} /tmp/test.nml
if test -f nmlclean.log ; then
mv nmlclean.log /tmp/nmlclean-1-$$.log
|
|
From: <pa...@us...> - 2003-08-25 00:38:26
|
Update of /cvsroot/emc/rtapi/src/rtapi
In directory sc8-pr-cvs1:/tmp/cvs-serv3693
Modified Files:
rtapi_proc.h
Log Message:
Can't use MOD_USE_INC/DEC macros because of the way the procfs_macros terminate
Index: rtapi_proc.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi_proc.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rtapi_proc.h 24 Aug 2003 09:38:25 -0000 1.4
--- rtapi_proc.h 25 Aug 2003 00:38:23 -0000 1.5
***************
*** 88,92 ****
{
PROC_PRINT_VARS;
- MOD_INC_USE_COUNT;
PROC_PRINT("******* RTAPI STATUS ********\n");
PROC_PRINT(" RT Modules = %i\n", rtapi_data->rt_module_count);
--- 88,91 ----
***************
*** 109,113 ****
PROC_PRINT("Message level = %i\n", rtapi_msg_level);
PROC_PRINT("\n");
- MOD_DEC_USE_COUNT;
PROC_PRINT_DONE;
}
--- 108,111 ----
***************
*** 121,125 ****
PROC_PRINT_VARS;
- MOD_INC_USE_COUNT;
PROC_PRINT("******* RTAPI MODULES *******\n");
PROC_PRINT("ID Type Name\n");
--- 119,122 ----
***************
*** 141,145 ****
}
PROC_PRINT("\n");
- MOD_DEC_USE_COUNT;
PROC_PRINT_DONE;
}
--- 138,141 ----
***************
*** 153,157 ****
PROC_PRINT_VARS;
- MOD_INC_USE_COUNT;
PROC_PRINT("******** RTAPI TASKS ********\n");
PROC_PRINT("ID Own Prio State Code\n");
--- 149,152 ----
***************
*** 180,184 ****
}
PROC_PRINT("\n");
- MOD_DEC_USE_COUNT;
PROC_PRINT_DONE;
}
--- 175,178 ----
***************
*** 191,195 ****
PROC_PRINT_VARS;
- MOD_INC_USE_COUNT;
PROC_PRINT("**** RTAPI SHARED MEMORY ****\n");
PROC_PRINT("ID Users Key Size\n");
--- 185,188 ----
***************
*** 203,207 ****
}
PROC_PRINT("\n");
- MOD_DEC_USE_COUNT;
PROC_PRINT_DONE;
}
--- 196,199 ----
***************
*** 214,218 ****
PROC_PRINT_VARS;
- MOD_INC_USE_COUNT;
PROC_PRINT("***** RTAPI SEMAPHORES ******\n");
PROC_PRINT("ID Users Key\n");
--- 206,209 ----
***************
*** 224,228 ****
}
PROC_PRINT("\n");
- MOD_DEC_USE_COUNT;
PROC_PRINT_DONE;
}
--- 215,218 ----
***************
*** 236,240 ****
PROC_PRINT_VARS;
- MOD_INC_USE_COUNT;
PROC_PRINT("******** RTAPI FIFOS ********\n");
PROC_PRINT("ID State Key Size\n");
--- 226,229 ----
***************
*** 260,264 ****
}
PROC_PRINT("\n");
- MOD_DEC_USE_COUNT;
PROC_PRINT_DONE;
}
--- 249,252 ----
***************
*** 269,273 ****
{
PROC_PRINT_VARS;
- MOD_INC_USE_COUNT;
PROC_PRINT("******* RTAPI MESSAGES ******\n");
PROC_PRINT(" Message Level = %i\n", rtapi_msg_level);
--- 257,260 ----
***************
*** 281,285 ****
rtapi_msg_level > RTAPI_MSG_DBG ? "ON" : "OFF");
PROC_PRINT("\n");
- MOD_DEC_USE_COUNT;
PROC_PRINT_DONE;
}
--- 268,271 ----
***************
*** 292,299 ****
char c;
- MOD_INC_USE_COUNT;
/* copy 1 byte from user space */
if (copy_from_user(&c, buffer, 1)) {
- MOD_DEC_USE_COUNT;
return -1;
}
--- 278,283 ----
***************
*** 305,309 ****
/* tell whoever called us that we used all the data, even
though we really only used the first byte */
- MOD_DEC_USE_COUNT;
return count;
}
--- 289,292 ----
|
Update of /cvsroot/emc/rtapi/src/rtapi
In directory sc8-pr-cvs1:/tmp/cvs-serv3121/src/rtapi
Modified Files:
procfs_macros.h rtai_rtapi.c rtai_ulapi.c rtapi.h
rtapi_common.h rtapi_proc.h sim_rtapi.c sim_ulapi.c ulapi.h
Log Message:
Added module ID, now rtapi_exit() should remove all items allocated by the module. Added a mutex to protect RTAPI internal data from simultaneous access. Basic testing complete, needs more detailed testing.
Index: procfs_macros.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/procfs_macros.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** procfs_macros.h 22 Aug 2003 19:48:38 -0000 1.1
--- procfs_macros.h 24 Aug 2003 09:38:25 -0000 1.2
***************
*** 59,62 ****
return len // no ";"
! #endif /* PROC_FS */
! #endif /* PROCFS_MACROS_H */
--- 59,62 ----
return len // no ";"
! #endif /* PROC_FS */
! #endif /* PROCFS_MACROS_H */
Index: rtai_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtai_rtapi.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** rtai_rtapi.c 20 Aug 2003 03:16:21 -0000 1.30
--- rtai_rtapi.c 24 Aug 2003 09:38:25 -0000 1.31
***************
*** 54,58 ****
#include <linux/kernel.h>
#include <linux/slab.h> /* replaces malloc.h in recent kernels */
- #include <linux/proc_fs.h> /* proc_fs functions */
#include <linux/ctype.h> /* isdigit */
#include <linux/delay.h> /* udelay */
--- 54,57 ----
***************
*** 80,86 ****
/* resource data unique to kernel space */
[...1528 lines suppressed...]
! return RTAPI_INVAL;
! }
! /* found the irq */
! irq_id = n;
! irq = &(irq_array[n]);
! /* get rid of the handler */
! rt_shutdown_irq(irq_num);
! retval = rt_free_global_irq(irq_num);
if (retval != 0) {
return RTAPI_FAIL;
}
! /* update data */
! irq->irq_num = 0;
! irq->owner = 0;
! irq->handler = NULL;
rtapi_data->irq_count--;
rtapi_print_msg(RTAPI_MSG_DBG,
! "RTAPI: handler for IRQ %d deleted\n", irq_num);
return RTAPI_SUCCESS;
}
Index: rtai_ulapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtai_ulapi.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** rtai_ulapi.c 20 Aug 2003 03:16:21 -0000 1.8
--- rtai_ulapi.c 24 Aug 2003 09:38:25 -0000 1.9
***************
*** 46,49 ****
--- 46,50 ----
#include <stdio.h> /* sprintf() */
+ #include <string.h> /* strcpy, etc. */
#include <stddef.h> /* NULL, needed for rtai_shm.h */
#include <unistd.h> /* open(), close() */
***************
*** 58,69 ****
#include "rtapi_common.h" /* private RTAPI/ULAPI decls */
/* resource data unique to this process */
! static void *shmem_addr_array[RTAPI_MAX_SHMEMS+1];
! static int fifo_fd_array[RTAPI_MAX_FIFOS+1];
! int ulapi_init(void)
{
! int n;
/* get shared memory block from OS and save its address */
--- 59,86 ----
#include "rtapi_common.h" /* private RTAPI/ULAPI decls */
+ /* the following are internal functions that do the real work associated
+ with deleting resources. They do not check the mutex that protects
+ the internal data structures. When someone calls a ulapi_xxx_delete()
+ function, the ulapi funct gets the mutex before calling one of these
+ internal functions. When internal code that already has the mutex
+ needs to delete something, it calls these functions directly.
+ */
+
+ static int shmem_delete(int shmem_id, int module_id);
+ static int fifo_delete(int fifo_id, int module_id);
+
/* resource data unique to this process */
! static void *shmem_addr_array[RTAPI_MAX_SHMEMS + 1];
! static int fifo_fd_array[RTAPI_MAX_FIFOS + 1];
! /***********************************************************************
! * GENERAL PURPOSE FUNCTIONS *
! ************************************************************************/
!
! int ulapi_init(char *modname)
{
! int n, module_id;
! module_data *module;
/* get shared memory block from OS and save its address */
***************
*** 73,78 ****
}
/* perform a global init if needed */
! init_rtapi_data ( rtapi_data );
/* set up local pointers to global data */
task_array = rtapi_data->task_array;
shmem_array = rtapi_data->shmem_array;
--- 90,96 ----
}
/* perform a global init if needed */
! init_rtapi_data(rtapi_data);
/* set up local pointers to global data */
+ module_array = rtapi_data->module_array;
task_array = rtapi_data->task_array;
shmem_array = rtapi_data->shmem_array;
***************
*** 84,116 ****
shmem_addr_array[n] = NULL;
}
! /* update module count */
! mutex_get ( &(rtapi_data->mutex) );
rtapi_data->ul_module_count++;
! mutex_give ( &(rtapi_data->mutex) );
! return ULAPI_SUCCESS;
}
! int ulapi_exit(void)
{
if (rtapi_data == NULL) {
! /* no inited */
return ULAPI_INVAL;
}
! /* do cleanup here, nothing implemented yet */
!
! /* update module count */
! mutex_get ( &(rtapi_data->mutex) );
rtapi_data->ul_module_count--;
! mutex_give ( &(rtapi_data->mutex) );
return ULAPI_SUCCESS;
}
/***********************************************************************
* SHARED MEMORY RELATED FUNCTIONS *
************************************************************************/
! int ulapi_shmem_new(int key, unsigned long int size)
{
int n;
--- 102,305 ----
shmem_addr_array[n] = NULL;
}
!
! /* get the mutex */
! mutex_get(&(rtapi_data->mutex));
! /* find empty spot in module array */
! n = 1;
! while ((n <= RTAPI_MAX_MODULES) && (module_array[n].state != NO_MODULE)) {
! n++;
! }
! if (n > RTAPI_MAX_MODULES) {
! /* no room */
! mutex_give(&(rtapi_data->mutex));
! return ULAPI_LIMIT;
! }
! /* we have space for the module */
! module_id = n;
! module = &(module_array[n]);
! /* update module data */
! module->state = USERSPACE;
! if (modname != NULL) {
! /* use name supplied by caller */
! snprintf(module->name, RTAPI_MODULE_NAME_LEN - 1, "%s", modname);
! module->name[RTAPI_MODULE_NAME_LEN - 1] = '\0';
! } else {
! /* make up a name */
! snprintf(module->name, RTAPI_MODULE_NAME_LEN - 1, "ULMOD%03d", module_id);
! }
rtapi_data->ul_module_count++;
! mutex_give(&(rtapi_data->mutex));
! return module_id;
}
! int ulapi_exit(int module_id)
{
+ module_data *module;
+ int n;
+
if (rtapi_data == NULL) {
! /* not inited */
return ULAPI_INVAL;
}
! /* validate module ID */
! if ((module_id < 1) || (module_id > RTAPI_MAX_MODULES)) {
! return ULAPI_BADID;
! }
! /* get mutex */
! mutex_get(&(rtapi_data->mutex));
! /* point to the module's data */
! module = &(module_array[module_id]);
! /* check module status */
! if (module->state != USERSPACE) {
! /* not an active user space module */
! mutex_give(&(rtapi_data->mutex));
! return ULAPI_INVAL;
! }
! /* clean up any mess left behind by the module */
! for (n = 1; n <= RTAPI_MAX_SHMEMS; n++) {
! if (test_bit(module_id, shmem_array[n].bitmap)) {
! fprintf(stderr,
! "ULAPI: WARNING: module '%s' failed to delete shmem %02d\n",
! module->name, n);
! shmem_delete(n, module_id);
! }
! }
! for (n = 1; n <= RTAPI_MAX_FIFOS; n++) {
! if ((fifo_array[n].reader == module_id) ||
! (fifo_array[n].writer == module_id)) {
! fprintf(stderr,
! "ULAPI: WARNING: module '%s' failed to delete fifo %02d\n",
! module->name, n);
! fifo_delete(n, module_id);
! }
! }
! /* update module data */
! module->state = NO_MODULE;
! module->name[0] = '\0';
rtapi_data->ul_module_count--;
! /* unmap shared memory block */
! mutex_give(&(rtapi_data->mutex));
! rtai_free(RTAPI_KEY, rtapi_data);
return ULAPI_SUCCESS;
}
+ void ulapi_printall ( void )
+ {
+ module_data *modules;
+ task_data *tasks;
+ shmem_data *shmems;
+ sem_data *sems;
+ fifo_data *fifos;
+ irq_data *irqs;
+ int n, m;
+
+ if ( rtapi_data == NULL ) {
+ printf ( "rtapi_data = NULL, not initialized\n" );
+ return;
+ }
+ printf ( "rtapi_data = %p\n", rtapi_data );
+ printf ( " magic = %d\n", rtapi_data->magic );
+ printf ( " mutex = %d\n", rtapi_data->mutex );
+ printf ( " rt_module_count = %d\n", rtapi_data->rt_module_count );
+ printf ( " ul_module_count = %d\n", rtapi_data->ul_module_count );
+ printf ( " task_count = %d\n", rtapi_data->task_count );
+ printf ( " shmem_count = %d\n", rtapi_data->shmem_count );
+ printf ( " sem_count = %d\n", rtapi_data->sem_count );
+ printf ( " fifo_count = %d\n", rtapi_data->fifo_count );
+ printf ( " irq_countc = %d\n", rtapi_data->irq_count );
+ printf ( " timer_running = %d\n", rtapi_data->timer_running );
+ printf ( " timer_period = %ld\n", rtapi_data->timer_period );
+ modules = &(rtapi_data->module_array[0]);
+ tasks = &(rtapi_data->task_array[0]);
+ shmems = &(rtapi_data->shmem_array[0]);
+ sems = &(rtapi_data->sem_array[0]);
+ fifos = &(rtapi_data->fifo_array[0]);
+ irqs = &(rtapi_data->irq_array[0]);
+ printf ( " module array = %p\n", modules );
+ printf ( " task array = %p\n", tasks );
+ printf ( " shmem array = %p\n", shmems );
+ printf ( " sem array = %p\n", sems );
+ printf ( " fifo array = %p\n", fifos );
+ printf ( " irq array = %p\n", irqs );
+ for ( n = 0 ; n <= RTAPI_MAX_MODULES ; n++ ) {
+ if ( modules[n].state != NO_MODULE ) {
+ printf ( " module %02d\n", n );
+ printf ( " state = %d\n", modules[n].state );
+ printf ( " name = %p\n", modules[n].name );
+ printf ( " name = '%s'\n", modules[n].name );
+ }
+ }
+ for ( n = 0 ; n <= RTAPI_MAX_TASKS ; n++ ) {
+ if ( tasks[n].state != EMPTY ) {
+ printf ( " task %02d\n", n );
+ printf ( " state = %d\n", tasks[n].state );
+ printf ( " prio = %d\n", tasks[n].prio );
+ printf ( " owner = %d\n", tasks[n].owner );
+ printf ( " code = %p\n", tasks[n].taskcode );
+ }
+ }
+ for ( n = 0 ; n <= RTAPI_MAX_SHMEMS ; n++ ) {
+ if ( shmems[n].key != 0 ) {
+ printf ( " shmem %02d\n", n );
+ printf ( " key = %d\n", shmems[n].key );
+ printf ( " rtusers = %d\n", shmems[n].rtusers );
+ printf ( " ulusers = %d\n", shmems[n].ulusers );
+ printf ( " size = %ld\n", shmems[n].size );
+ printf ( " bitmap = " );
+ for ( m = 0 ; m <= RTAPI_MAX_MODULES ; m++ ) {
+ if ( test_bit ( m, shmems[n].bitmap ) ) {
+ putchar ( '1' );
+ }
+ else {
+ putchar ( '0' );
+ }
+ }
+ putchar ( '\n' );
+ }
+ }
+ for ( n = 0 ; n <= RTAPI_MAX_SEMS ; n++ ) {
+ if ( sems[n].key != 0 ) {
+ printf ( " sem %02d\n", n );
+ printf ( " key = %d\n", sems[n].key );
+ printf ( " users = %d\n", sems[n].users );
+ printf ( " bitmap = " );
+ for ( m = 0 ; m <= RTAPI_MAX_MODULES ; m++ ) {
+ if ( test_bit ( m, sems[n].bitmap ) ) {
+ putchar ( '1' );
+ }
+ else {
+ putchar ( '0' );
+ }
+ }
+ putchar ( '\n' );
+ }
+ }
+ for ( n = 0 ; n <= RTAPI_MAX_FIFOS ; n++ ) {
+ if ( fifos[n].state != UNUSED ) {
+ printf ( " fifo %02d\n", n );
+ printf ( " state = %d\n", fifos[n].state );
+ printf ( " key = %d\n", fifos[n].key );
+ printf ( " reader = %d\n", fifos[n].reader );
+ printf ( " writer = %d\n", fifos[n].writer );
+ printf ( " size = %ld\n", fifos[n].size );
+ }
+ }
+ for ( n = 0 ; n <= RTAPI_MAX_IRQS ; n++ ) {
+ if ( irqs[n].irq_num != 0 ) {
+ printf ( " irq %02d\n", n );
+ printf ( " irq_num = %d\n", irqs[n].irq_num );
+ printf ( " owner = %d\n", irqs[n].owner );
+ printf ( " handler = %p\n", irqs[n].handler );
+ }
+ }
+ }
+
/***********************************************************************
* SHARED MEMORY RELATED FUNCTIONS *
************************************************************************/
! int ulapi_shmem_new(int key, int module_id, unsigned long int size)
{
int n;
***************
*** 119,128 ****
/* key must be non-zero, and also cannot match the key that RTAPI uses */
! if (( key == 0 ) || ( key == RTAPI_KEY )) {
return ULAPI_INVAL;
}
/* check if a block is already open for this key */
! for ( n = 1; n <= RTAPI_MAX_SHMEMS ; n++ ) {
! if ( shmem_array[n].key == key ) {
/* found a match */
shmem_id = n;
--- 308,328 ----
/* key must be non-zero, and also cannot match the key that RTAPI uses */
! if ((key == 0) || (key == RTAPI_KEY)) {
! return ULAPI_INVAL;
! }
! /* get the mutex */
! mutex_get(&(rtapi_data->mutex));
! /* validate module_id */
! if ((module_id < 1) || (module_id > RTAPI_MAX_MODULES)) {
! mutex_give(&(rtapi_data->mutex));
! return ULAPI_INVAL;
! }
! if (module_array[module_id].state != USERSPACE) {
! mutex_give(&(rtapi_data->mutex));
return ULAPI_INVAL;
}
/* check if a block is already open for this key */
! for (n = 1; n <= RTAPI_MAX_SHMEMS; n++) {
! if (shmem_array[n].key == key) {
/* found a match */
shmem_id = n;
***************
*** 130,149 ****
/* is it big enough? */
if (shmem->size < size) {
return ULAPI_INVAL;
}
! /* yes, has this process already mapped it? */
! if (shmem_addr_array[shmem_id] != 0 ) {
! /* can't map twice */
! return ULAPI_FAIL;
}
/* no, map it */
shmem_addr_array[shmem_id] = rtai_malloc(key, shmem->size);
if (shmem_addr_array[shmem_id] == NULL) {
! /* map failed */
! return ULAPI_NOMEM;
}
/* update usage data */
shmem->ulusers++;
/* done */
return shmem_id;
}
--- 330,353 ----
/* is it big enough? */
if (shmem->size < size) {
+ mutex_give(&(rtapi_data->mutex));
return ULAPI_INVAL;
}
! /* is this module already using it? */
! if (test_bit(module_id, shmem->bitmap)) {
! mutex_give(&(rtapi_data->mutex));
! return ULAPI_INVAL;
}
/* no, map it */
shmem_addr_array[shmem_id] = rtai_malloc(key, shmem->size);
if (shmem_addr_array[shmem_id] == NULL) {
! /* map failed */
! mutex_give(&(rtapi_data->mutex));
! return ULAPI_NOMEM;
}
/* update usage data */
+ set_bit(module_id, shmem->bitmap);
shmem->ulusers++;
/* done */
+ mutex_give(&(rtapi_data->mutex));
return shmem_id;
}
***************
*** 151,160 ****
/* find empty spot in shmem array */
n = 1;
! while ((n <= RTAPI_MAX_SHMEMS) &&
! (shmem_array[n].key != 0)) {
n++;
}
if (n > RTAPI_MAX_SHMEMS) {
/* no room */
return ULAPI_LIMIT;
}
--- 355,364 ----
/* find empty spot in shmem array */
n = 1;
! while ((n <= RTAPI_MAX_SHMEMS) && (shmem_array[n].key != 0)) {
n++;
}
if (n > RTAPI_MAX_SHMEMS) {
/* no room */
+ mutex_give(&(rtapi_data->mutex));
return ULAPI_LIMIT;
}
***************
*** 165,171 ****
shmem_addr_array[shmem_id] = rtai_malloc(key, size);
if (shmem_addr_array[shmem_id] == NULL) {
return ULAPI_NOMEM;
}
! /* fill in the data */
shmem->key = key;
shmem->rtusers = 0;
--- 369,377 ----
shmem_addr_array[shmem_id] = rtai_malloc(key, size);
if (shmem_addr_array[shmem_id] == NULL) {
+ mutex_give(&(rtapi_data->mutex));
return ULAPI_NOMEM;
}
! /* the block has been created, update data */
! set_bit(module_id, shmem->bitmap);
shmem->key = key;
shmem->rtusers = 0;
***************
*** 174,185 ****
rtapi_data->shmem_count++;
/* done */
return shmem_id;
}
! int ulapi_shmem_delete(int shmem_id)
{
! shmem_data *shmem;
/* validate shmem ID */
if ((shmem_id < 1) || (shmem_id > RTAPI_MAX_SHMEMS)) {
--- 380,402 ----
rtapi_data->shmem_count++;
/* done */
+ mutex_give(&(rtapi_data->mutex));
return shmem_id;
}
! int ulapi_shmem_delete(int shmem_id, int module_id)
{
! int retval;
+ mutex_get(&(rtapi_data->mutex));
+ retval = shmem_delete(shmem_id, module_id);
+ mutex_give(&(rtapi_data->mutex));
+ return retval;
+ }
+
+
+ int shmem_delete(int shmem_id, int module_id)
+ {
+ shmem_data *shmem;
/* validate shmem ID */
if ((shmem_id < 1) || (shmem_id > RTAPI_MAX_SHMEMS)) {
***************
*** 189,202 ****
shmem = &(shmem_array[shmem_id]);
/* is the block valid? */
! if (shmem->key == 0 ) {
return ULAPI_BADID;
}
/* unmap the block */
rtai_free(shmem->key, shmem_addr_array[shmem_id]);
shmem_addr_array[shmem_id] = NULL;
- /* update data */
- shmem->ulusers--;
/* is somebody else still using the block? */
! if ((shmem->ulusers > 0 ) || (shmem->rtusers > 0 )) {
/* yes, we're done for now */
return ULAPI_SUCCESS;
--- 406,431 ----
shmem = &(shmem_array[shmem_id]);
/* is the block valid? */
! if (shmem->key == 0) {
return ULAPI_BADID;
}
+ /* validate module_id */
+ if ((module_id < 1) || (module_id > RTAPI_MAX_MODULES)) {
+ return ULAPI_INVAL;
+ }
+ if (module_array[module_id].state != USERSPACE) {
+ return ULAPI_INVAL;
+ }
+ /* is this module using the block? */
+ if (test_bit(module_id, shmem->bitmap) == 0) {
+ return ULAPI_INVAL;
+ }
+ /* OK, we're no longer using it */
+ clear_bit(module_id, shmem->bitmap);
+ shmem->ulusers--;
/* unmap the block */
rtai_free(shmem->key, shmem_addr_array[shmem_id]);
shmem_addr_array[shmem_id] = NULL;
/* is somebody else still using the block? */
! if ((shmem->ulusers > 0) || (shmem->rtusers > 0)) {
/* yes, we're done for now */
return ULAPI_SUCCESS;
***************
*** 217,221 ****
}
/* is the block mapped? */
! if (shmem_addr_array[shmem_id] == NULL ) {
return ULAPI_BADID;
}
--- 446,450 ----
}
/* is the block mapped? */
! if (shmem_addr_array[shmem_id] == NULL) {
return ULAPI_BADID;
}
***************
*** 226,230 ****
! int ulapi_fifo_new(int key, unsigned long int size, char mode)
{
enum { DEVSTR_LEN = 256 };
--- 455,463 ----
! /***********************************************************************
! * FIFO RELATED FUNCTIONS *
! ************************************************************************/
!
! int ulapi_fifo_new(int key, int module_id, unsigned long int size, char mode)
{
enum { DEVSTR_LEN = 256 };
***************
*** 235,243 ****
/* key must be non-zero */
! if ( key == 0 ) {
return ULAPI_INVAL;
}
/* mode must be "R" or "W" */
! if (( mode != 'R' ) && ( mode != 'W' )) {
return ULAPI_INVAL;
}
--- 468,476 ----
/* key must be non-zero */
! if (key == 0) {
return ULAPI_INVAL;
}
/* mode must be "R" or "W" */
! if ((mode != 'R') && (mode != 'W')) {
return ULAPI_INVAL;
}
***************
*** 245,254 ****
if (mode == 'R') {
flags = O_RDONLY;
! }
! else /* mode == 'W' */ {
flags = O_WRONLY;
}
/* check if a fifo already exists for this key */
! for ( n = 1; n <= RTAPI_MAX_FIFOS ; n++ ) {
if ((fifo_array[n].state != UNUSED) && (fifo_array[n].key == key)) {
/* found a match */
--- 478,498 ----
if (mode == 'R') {
flags = O_RDONLY;
! } else { /* mode == 'W' */
!
flags = O_WRONLY;
}
+ /* get the mutex */
+ mutex_get(&(rtapi_data->mutex));
+ /* validate module_id */
+ if ((module_id < 1) || (module_id > RTAPI_MAX_MODULES)) {
+ mutex_give(&(rtapi_data->mutex));
+ return ULAPI_INVAL;
+ }
+ if (module_array[module_id].state != USERSPACE) {
+ mutex_give(&(rtapi_data->mutex));
+ return ULAPI_INVAL;
+ }
/* check if a fifo already exists for this key */
! for (n = 1; n <= RTAPI_MAX_FIFOS; n++) {
if ((fifo_array[n].state != UNUSED) && (fifo_array[n].key == key)) {
/* found a match */
***************
*** 256,261 ****
fifo = &(fifo_array[n]);
/* is the desired mode available */
! if ( mode == 'R' ) {
! if ( fifo->state & HAS_READER ) {
return ULAPI_BUSY;
}
--- 500,506 ----
fifo = &(fifo_array[n]);
/* is the desired mode available */
! if (mode == 'R') {
! if (fifo->state & HAS_READER) {
! mutex_give(&(rtapi_data->mutex));
return ULAPI_BUSY;
}
***************
*** 266,277 ****
if (fifo_fd_array[fifo_id] < 0) {
/* open failed */
return ULAPI_NOTFND;
}
/* fifo opened, update status */
fifo->state |= HAS_READER;
return fifo_id;
! }
! else /* mode == 'W' */ {
! if ( fifo->state & HAS_WRITER ) {
return ULAPI_BUSY;
}
--- 511,526 ----
if (fifo_fd_array[fifo_id] < 0) {
/* open failed */
+ mutex_give(&(rtapi_data->mutex));
return ULAPI_NOTFND;
}
/* fifo opened, update status */
fifo->state |= HAS_READER;
+ fifo->reader = module_id;
+ mutex_give(&(rtapi_data->mutex));
return fifo_id;
! } else { /* mode == 'W' */
!
! if (fifo->state & HAS_WRITER) {
! mutex_give(&(rtapi_data->mutex));
return ULAPI_BUSY;
}
***************
*** 282,289 ****
--- 531,541 ----
if (fifo_fd_array[fifo_id] < 0) {
/* open failed */
+ mutex_give(&(rtapi_data->mutex));
return ULAPI_NOTFND;
}
/* fifo opened, update status */
fifo->state |= HAS_WRITER;
+ fifo->writer = module_id;
+ mutex_give(&(rtapi_data->mutex));
return fifo_id;
}
***************
*** 292,301 ****
/* find empty spot in fifo array */
n = 1;
! while ((n <= RTAPI_MAX_FIFOS) &&
! (fifo_array[n].state != UNUSED)) {
n++;
}
if (n > RTAPI_MAX_FIFOS) {
/* no room */
return ULAPI_LIMIT;
}
--- 544,553 ----
/* find empty spot in fifo array */
n = 1;
! while ((n <= RTAPI_MAX_FIFOS) && (fifo_array[n].state != UNUSED)) {
n++;
}
if (n > RTAPI_MAX_FIFOS) {
/* no room */
+ mutex_give(&(rtapi_data->mutex));
return ULAPI_LIMIT;
}
***************
*** 309,320 ****
if (fifo_fd_array[fifo_id] < 0) {
/* open failed */
return ULAPI_NOTFND;
}
/* the fifo has been created, update data */
! if ( mode == 'R' ) {
fifo->state = HAS_READER;
! }
! else /* mode == 'W' */ {
fifo->state = HAS_WRITER;
}
fifo->key = key;
--- 561,575 ----
if (fifo_fd_array[fifo_id] < 0) {
/* open failed */
+ mutex_give(&(rtapi_data->mutex));
return ULAPI_NOTFND;
}
/* the fifo has been created, update data */
! if (mode == 'R') {
fifo->state = HAS_READER;
! fifo->reader = module_id;
! } else { /* mode == 'W' */
!
fifo->state = HAS_WRITER;
+ fifo->writer = module_id;
}
fifo->key = key;
***************
*** 322,330 ****
rtapi_data->fifo_count++;
/* done */
return fifo_id;
}
! int ulapi_fifo_delete(int fifo_id, char mode)
{
fifo_data *fifo;
--- 577,597 ----
rtapi_data->fifo_count++;
/* done */
+ mutex_give(&(rtapi_data->mutex));
return fifo_id;
}
! int ulapi_fifo_delete(int fifo_id, int module_id)
! {
! int retval;
!
! mutex_get(&(rtapi_data->mutex));
! retval = fifo_delete(fifo_id, module_id);
! mutex_give(&(rtapi_data->mutex));
! return retval;
! }
!
!
! static int fifo_delete(int fifo_id, int module_id)
{
fifo_data *fifo;
***************
*** 337,371 ****
fifo = &(fifo_array[fifo_id]);
/* is the fifo valid? */
! if (fifo->state == UNUSED ) {
return ULAPI_BADID;
}
! /* check fifo state */
! if ( mode == 'R' ) {
! if (( fifo->state & HAS_READER ) == 0 ) {
! return ULAPI_INVAL;
! }
! /* close the fifo */
! if (close(fifo_id) < 0) {
! return ULAPI_NOTFND;
! }
! /* update fifo state */
fifo->state &= ~HAS_READER;
}
! else if ( mode == 'W' ) {
! if (( fifo->state & HAS_WRITER ) == 0 ) {
! return ULAPI_INVAL;
! }
! /* close the fifo */
! if (close(fifo_id) < 0) {
! return ULAPI_NOTFND;
! }
! /* update fifo state */
fifo->state &= ~HAS_WRITER;
}
! else {
! return ULAPI_INVAL;
}
/* is somebody else still using the fifo */
! if ( fifo->state != UNUSED ) {
/* yes, done for now */
return ULAPI_SUCCESS;
--- 604,636 ----
fifo = &(fifo_array[fifo_id]);
/* is the fifo valid? */
! if (fifo->state == UNUSED) {
return ULAPI_BADID;
}
! /* validate module_id */
! if ((module_id < 1) || (module_id > RTAPI_MAX_MODULES)) {
! return ULAPI_INVAL;
! }
! if (module_array[module_id].state != USERSPACE) {
! return ULAPI_INVAL;
! }
! /* is this module using the fifo? */
! if ((fifo->reader != module_id) && (fifo->writer != module_id)) {
! return ULAPI_INVAL;
! }
! /* update fifo state */
! if (fifo->reader == module_id) {
fifo->state &= ~HAS_READER;
+ fifo->reader = 0;
}
! if (fifo->writer == module_id) {
fifo->state &= ~HAS_WRITER;
+ fifo->writer = 0;
}
! /* close the fifo */
! if (close(fifo_id) < 0) {
! return ULAPI_NOTFND;
}
/* is somebody else still using the fifo */
! if (fifo->state != UNUSED) {
/* yes, done for now */
return ULAPI_SUCCESS;
***************
*** 393,397 ****
fifo = &(fifo_array[fifo_id]);
/* is the fifo valid? */
! if ((fifo->state & HAS_READER) == 0 ) {
return ULAPI_BADID;
}
--- 658,662 ----
fifo = &(fifo_array[fifo_id]);
/* is the fifo valid? */
! if ((fifo->state & HAS_READER) == 0) {
return ULAPI_BADID;
}
***************
*** 417,421 ****
fifo = &(fifo_array[fifo_id]);
/* is the fifo valid? */
! if ((fifo->state & HAS_WRITER) == 0 ) {
return ULAPI_BADID;
}
--- 682,686 ----
fifo = &(fifo_array[fifo_id]);
/* is the fifo valid? */
! if ((fifo->state & HAS_WRITER) == 0) {
return ULAPI_BADID;
}
Index: rtapi.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** rtapi.h 22 Aug 2003 19:48:38 -0000 1.28
--- rtapi.h 24 Aug 2003 09:38:25 -0000 1.29
***************
*** 65,82 ****
/** 'rtapi_init() sets up the RTAPI. It must be called by any module
! that intends to use the API, before any other RTAPI calls. Returns
! a status code, as defined above. Increments a usage count. Call
! only from within init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_init(void);
/** 'rtapi_exit()' shuts down and cleans up the RTAPI. It must be
called prior to exit by any module that called rtapi_init.
! Returns a status code. Decrements the usage count maintained
! by rtapi_init. Call only from within init/cleanup code, not
! from realtime tasks.
*/
! extern int rtapi_exit(void);
--- 65,91 ----
/** 'rtapi_init() sets up the RTAPI. It must be called by any module
! that intends to use the API, before any other RTAPI calls.
! 'modname' can optionally point to a string that identifies
! the module. The string will be truncated at 32 characters.
! If 'modname' is NULL, the system will assign a name.
! On success, returns a positive integer module ID, which is
! used for subsequent calls to rtapi_xxx_new, rtapi_xxx_delete,
! and rtapi_exit. On failure, returns an error code as defined
! above. Call only from within init/cleanup code, not from
! realtime tasks.
*/
! extern int rtapi_init(char *modname);
/** 'rtapi_exit()' shuts down and cleans up the RTAPI. It must be
called prior to exit by any module that called rtapi_init.
! 'module_id' is the ID code returned when that module called
! rtapi_init(). Returns a status code. rtapi_exit() may attempt
! to clean up any tasks and other resources allocated by the
! module, but should not be relied on to replace proper cleanup
! code within the module. Call only from within init/cleanup
! code, not from realtime tasks.
*/
! extern int rtapi_exit(int module_id);
***************
*** 203,220 ****
int value when the task is started.
'prio' is the priority, as determined by one of the priority
! functions above. 'stacksize' is the amount of stack to be used
! for the task - be generous, hardware interrupts may use the same
! stack. 'uses_fp' is a flag that tells the OS whether the task uses
! floating point so it can save the FPU registers on a task switch.
! Failing to save registers when needed causes the dreaded "NAN bug",
! so most tasks should set 'uses_fp' to RTAPI_USES_FP. If a task
definitely does not use floating point, setting 'uses_fp' to
! RTAPI_NO_FP saves a few microseconds per task switch.
! Call only from within init/cleanup code, not from realtime tasks.
*/
#define RTAPI_NO_FP 0
#define RTAPI_USES_FP 1
extern int rtapi_task_new(void (*taskcode) (int),
! int arg, int prio,
unsigned long int stacksize, int uses_fp);
--- 212,231 ----
int value when the task is started.
'prio' is the priority, as determined by one of the priority
! functions above. 'owner' is the module ID of the module that
! is making the call (see rtapi_init). 'stacksize' is the amount
! of stack to be used for the task - be generous, hardware
! interrupts may use the same stack. 'uses_fp' is a flag that
! tells the OS whether the task uses floating point so it can
! save the FPU registers on a task switch. Failing to save
! registers when needed causes the dreaded "NAN bug", so most
! tasks should set 'uses_fp' to RTAPI_USES_FP. If a task
definitely does not use floating point, setting 'uses_fp' to
! RTAPI_NO_FP saves a few microseconds per task switch. Call
! only from within init/cleanup code, not from realtime tasks.
*/
#define RTAPI_NO_FP 0
#define RTAPI_USES_FP 1
extern int rtapi_task_new(void (*taskcode) (int),
! int arg, int prio, int owner,
unsigned long int stacksize, int uses_fp);
***************
*** 299,317 ****
identifies the memory block, and must be non-zero. All modules
wishing to access the same memory must use the same key.
! The block will be at least 'size' bytes, and may be rounded up.
! Allocating many small blocks may be very wasteful. On success,
! it returns a positive integer ID, which is used for all subsequent
! calls dealing with the block. On failure it returns a negative
! error code. Call only from within init/cleanup code, not from
! realtime tasks.
*/
! extern int rtapi_shmem_new(int key, unsigned long int size);
/** 'rtapi_shmem_delete()' frees the shared memory block associated
! with 'shmem_id'. Returns a status code. Call only from within
! init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_shmem_delete(int shmem_id);
/** 'rtapi_shmem_getptr()' sets '*ptr' to point to shared memory block
--- 310,330 ----
identifies the memory block, and must be non-zero. All modules
wishing to access the same memory must use the same key.
! 'module_id' is the ID of the module that is making the call (see
! rtapi_init). The block will be at least 'size' bytes, and may
! be rounded up. Allocating many small blocks may be very wasteful.
! On success, it returns a positive integer ID, which is used for
! all subsequent calls dealing with the block. On failure it
! returns a negative error code. Call only from within init/cleanup
! code, not from realtime tasks.
*/
! extern int rtapi_shmem_new(int key, int module_id, unsigned long int size);
/** 'rtapi_shmem_delete()' frees the shared memory block associated
! with 'shmem_id'. 'module_id' is the ID of the calling module.
! Returns a status code. Call only from within init/cleanup code,
! not from realtime tasks.
*/
! extern int rtapi_shmem_delete(int shmem_id, int module_id);
/** 'rtapi_shmem_getptr()' sets '*ptr' to point to shared memory block
***************
*** 328,346 ****
/** 'rtapi_sem_new()' creates a realtime semaphore. 'key' identifies
identifies the semaphore, and must be non-zero. All modules wishing
! to use the same semaphore must specify the same key. On success, it
! returns a positive integer ID, which is used for all subsequent
! calls dealing with the semaphore. On failure it returns a negative
! error code. Call only from within init/cleanup code, not from
! realtime tasks.
*/
! extern int rtapi_sem_new(int key);
/** 'rtapi_sem_delete()' is the counterpart to 'rtapi_sem_new()'. It
discards the semaphore associated with 'sem_id'. Any tasks blocked
! on 'sem' will resume execution. Returns a status code. Call only
! from within init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_sem_delete(int sem_id);
--- 341,361 ----
/** 'rtapi_sem_new()' creates a realtime semaphore. 'key' identifies
identifies the semaphore, and must be non-zero. All modules wishing
! to use the same semaphore must specify the same key. 'module_id'
! is the ID of the module making the call (see rtapi_init). On
! success, it returns a positive integer semaphore ID, which is used
! for all subsequent calls dealing with the semaphore. On failure
! it returns a negative error code. Call only from within init/cleanup
! code, not from realtime tasks.
*/
! extern int rtapi_sem_new(int key, int module_id);
/** 'rtapi_sem_delete()' is the counterpart to 'rtapi_sem_new()'. It
discards the semaphore associated with 'sem_id'. Any tasks blocked
! on 'sem' will resume execution. 'module_id' is the ID of the calling
! module. Returns a status code. Call only from within init/cleanup
! code, not from realtime tasks.
*/
! extern int rtapi_sem_delete(int sem_id, int module_id);
***************
*** 378,386 ****
/** 'rtapi_fifo_new()' creates a realtime fifo. 'key' identifies the
fifo, all modules wishing to access the same fifo must use the same
! key. 'size' is the depth of the fifo. 'mode' is either 'R' or 'W',
! to request either read or write access to the fifo. On success, it
! returns a positive integer ID, which is used for subsequent calls
! dealing with the fifo. On failure, returns a negative error code.
! Call only from within init/cleanup code, not from realtime tasks.
*/
--- 393,403 ----
/** 'rtapi_fifo_new()' creates a realtime fifo. 'key' identifies the
fifo, all modules wishing to access the same fifo must use the same
! key. 'module_id' is the ID of the module making the call (see
! rtapi_init). 'size' is the depth of the fifo. 'mode' is either
! 'R' or 'W', to request either read or write access to the fifo.
! On success, it returns a positive integer ID, which is used for
! subsequent calls dealing with the fifo. On failure, returns a
! negative error code. Call only from within init/cleanup code,
! not from realtime tasks.
*/
***************
*** 388,400 ****
oops messages on removal. (Does this apply to rtlinux as well ?)
*/
! extern int rtapi_fifo_new(int key, unsigned long int size, char mode);
/** 'rtapi_fifo_delete()' is the counterpart to 'rtapi_fifo_new()'.
! It closes the fifo associated with 'fifo_ID'. 'mode' is the mode
! that was specified when the fifo was created. Returns status code.
! Call only from within init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_fifo_delete(int fifo_id, char mode);
--- 405,418 ----
oops messages on removal. (Does this apply to rtlinux as well ?)
*/
! extern int rtapi_fifo_new(int key, int module_id,
! unsigned long int size, char mode);
/** 'rtapi_fifo_delete()' is the counterpart to 'rtapi_fifo_new()'.
! It closes the fifo associated with 'fifo_ID'. 'module_id' is the
! ID of the calling module. Returns status code. Call only from
! within init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_fifo_delete(int fifo_id, int module_id);
***************
*** 439,448 ****
a hardware interrupt. 'irq' is the interrupt number, and 'handler'
is a pointer to a function taking no arguements and returning void.
! 'handler will be called when the interrupt occurs. Returns a status
code. Note: The simulated RTOS does not support interrupts.
Call only from within init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_assign_interrupt_handler(unsigned int irq,
! void (*handler) (void));
--- 457,467 ----
a hardware interrupt. 'irq' is the interrupt number, and 'handler'
is a pointer to a function taking no arguements and returning void.
! 'handler will be called when the interrupt occurs. 'owner' is the
! ID of the calling module (see rtapi_init). Returns a status
code. Note: The simulated RTOS does not support interrupts.
Call only from within init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_irq_new(unsigned int irq_num, int owner,
! void (*handler) (void));
***************
*** 454,458 ****
init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_free_interrupt_handler(unsigned int irq);
--- 473,477 ----
init/cleanup code, not from realtime tasks.
*/
! extern int rtapi_irq_delete(unsigned int irq_num);
Index: rtapi_common.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi_common.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rtapi_common.h 22 Aug 2003 19:48:38 -0000 1.3
--- rtapi_common.h 24 Aug 2003 09:38:25 -0000 1.4
***************
*** 51,57 ****
*/
/* These structs hold data associated with objects like tasks, etc. */
! typedef enum { EMPTY = 0,
PAUSED,
PERIODIC,
--- 51,80 ----
*/
+ /* maximum number of various resources */
+ #define RTAPI_MAX_MODULES 64
+ #define RTAPI_MAX_TASKS 64
+ #define RTAPI_MAX_SHMEMS 32
+ #define RTAPI_MAX_SEMS 64
+ #define RTAPI_MAX_FIFOS 32
+ #define RTAPI_MAX_IRQS 16
+
/* These structs hold data associated with objects like tasks, etc. */
! #define RTAPI_MODULE_NAME_LEN 32
!
! typedef enum {
! NO_MODULE = 0,
! REALTIME,
! USERSPACE
! } mod_type_t;
!
! typedef struct {
! mod_type_t state;
! char name[RTAPI_MODULE_NAME_LEN];
! } module_data;
!
!
! typedef enum {
! EMPTY = 0,
PAUSED,
PERIODIC,
***************
*** 63,66 ****
--- 86,90 ----
task_state_t state; /* task state */
int prio; /* priority */
+ int owner; /* owning module */
void *taskcode; /* task code */
} task_data;
***************
*** 72,85 ****
int ulusers; /* number of user processes using block */
unsigned long size; /* size of shared memory area */
} shmem_data;
typedef struct {
! int users; /* number of modules using the area */
! int key; /* key to shared memory area */
} sem_data;
! typedef enum { UNUSED = 0,
HAS_READER = 1,
HAS_WRITER = 2,
--- 96,112 ----
int ulusers; /* number of user processes using block */
unsigned long size; /* size of shared memory area */
+ char bitmap[(RTAPI_MAX_SHMEMS / 8) + 1]; /* which modules are using block */
} shmem_data;
typedef struct {
! int users; /* number of modules using the semaphore */
! int key; /* key to semaphore */
! char bitmap[(RTAPI_MAX_SEMS / 8) + 1]; /* which modules are using sem */
} sem_data;
! typedef enum {
! UNUSED = 0,
HAS_READER = 1,
HAS_WRITER = 2,
***************
*** 90,93 ****
--- 117,122 ----
fifo_state_t state; /* task state */
int key; /* key to fifo */
+ int reader; /* module ID of reader */
+ int writer; /* module ID of writer */
unsigned long int size; /* size of fifo area */
} fifo_data;
***************
*** 95,108 ****
typedef struct {
int irq_num; /* IRQ number */
} irq_data;
- /* maximum number of various resources */
- #define RTAPI_MAX_TASKS 64
- #define RTAPI_MAX_SHMEMS 32
- #define RTAPI_MAX_SEMS 64
- #define RTAPI_MAX_FIFOS 32
- #define RTAPI_MAX_IRQS 16
-
/* Master RTAPI data structure
There is a single instance of this structure in the machine.
--- 124,132 ----
typedef struct {
int irq_num; /* IRQ number */
+ int owner; /* owning module */
+ void (*handler) (void); /* interrupt handler function */
} irq_data;
/* Master RTAPI data structure
There is a single instance of this structure in the machine.
***************
*** 125,128 ****
--- 149,153 ----
int timer_running; /* state of HW timer */
long int timer_period; /* HW timer period */
+ module_data module_array[RTAPI_MAX_MODULES + 1]; /* data for modules */
task_data task_array[RTAPI_MAX_TASKS + 1]; /* data for tasks */
shmem_data shmem_array[RTAPI_MAX_SHMEMS + 1]; /* data for shared memory */
***************
*** 146,149 ****
--- 171,175 ----
rtapi_data_t *rtapi_data = NULL;
+ module_data *module_array = NULL;
task_data *task_array = NULL;
shmem_data *shmem_array = NULL;
***************
*** 199,203 ****
static void init_rtapi_data(rtapi_data_t * data)
{
! int n;
/* has the block already been initialized? */
--- 225,229 ----
static void init_rtapi_data(rtapi_data_t * data)
{
! int n, m;
/* has the block already been initialized? */
***************
*** 221,227 ****
--- 247,258 ----
data->timer_period = 0;
/* init the arrays */
+ for (n = 0; n <= RTAPI_MAX_MODULES; n++) {
+ data->module_array[n].state = EMPTY;
+ data->module_array[n].name[0] = '\0';
+ }
for (n = 0; n <= RTAPI_MAX_TASKS; n++) {
data->task_array[n].state = EMPTY;
data->task_array[n].prio = 0;
+ data->task_array[n].owner = 0;
data->task_array[n].taskcode = NULL;
}
***************
*** 231,238 ****
--- 262,275 ----
data->shmem_array[n].ulusers = 0;
data->shmem_array[n].size = 0;
+ for (m = 0; m < (RTAPI_MAX_SHMEMS / 8) + 1; m++) {
+ data->shmem_array[n].bitmap[m] = 0;
+ }
}
for (n = 0; n <= RTAPI_MAX_SEMS; n++) {
data->sem_array[n].users = 0;
data->sem_array[n].key = 0;
+ for (m = 0; m < (RTAPI_MAX_SEMS / 8) + 1; m++) {
+ data->sem_array[n].bitmap[m] = 0;
+ }
}
for (n = 0; n <= RTAPI_MAX_FIFOS; n++) {
***************
*** 240,246 ****
--- 277,287 ----
data->fifo_array[n].key = 0;
data->fifo_array[n].size = 0;
+ data->fifo_array[n].reader = 0;
+ data->fifo_array[n].writer = 0;
}
for (n = 0; n <= RTAPI_MAX_IRQS; n++) {
data->irq_array[n].irq_num = 0;
+ data->irq_array[n].owner = 0;
+ data->irq_array[n].handler = NULL;
}
/* done, release the mutex */
Index: rtapi_proc.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/rtapi_proc.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rtapi_proc.h 22 Aug 2003 19:48:38 -0000 1.3
--- rtapi_proc.h 24 Aug 2003 09:38:25 -0000 1.4
***************
*** 53,57 ****
information, go to www.linuxcnc.org.
*/
- #include "procfs_macros.h"
/* Internal function for the proc_fs system. */
--- 53,56 ----
***************
*** 65,70 ****
--- 64,72 ----
#ifdef CONFIG_PROC_FS
+ #include "procfs_macros.h" /* macros for read functions */
+
static struct proc_dir_entry *rtapi_dir = 0; /* /proc/rtapi directory */
static struct proc_dir_entry *status_file = 0; /* /proc/rtapi/status */
+ static struct proc_dir_entry *modules_file = 0; /* /proc/rtapi/modules */
static struct proc_dir_entry *tasks_file = 0; /* /proc/rtapi/tasks */
static struct proc_dir_entry *shmem_file = 0; /* /proc/rtapi/shmem */
***************
*** 90,97 ****
PROC_PRINT(" RT Modules = %i\n", rtapi_data->rt_module_count);
PROC_PRINT(" UL Modules = %i\n", rtapi_data->ul_module_count);
! PROC_PRINT(" Tasks = %i/%i\n", rtapi_data->task_count, RTAPI_MAX_TASKS);
! PROC_PRINT("Shared memory = %i/%i\n", rtapi_data->shmem_count, RTAPI_MAX_SHMEMS);
! PROC_PRINT(" FIFOs = %i/%i\n", rtapi_data->fifo_count, RTAPI_MAX_FIFOS);
! PROC_PRINT(" Semaphores = %i/%i\n", rtapi_data->sem_count, RTAPI_MAX_SEMS);
PROC_PRINT(" Interrupts = %i\n", rtapi_data->irq_count);
if (rtapi_data->timer_running) {
--- 92,103 ----
PROC_PRINT(" RT Modules = %i\n", rtapi_data->rt_module_count);
PROC_PRINT(" UL Modules = %i\n", rtapi_data->ul_module_count);
! PROC_PRINT(" Tasks = %i/%i\n", rtapi_data->task_count,
! RTAPI_MAX_TASKS);
! PROC_PRINT("Shared memory = %i/%i\n", rtapi_data->shmem_count,
! RTAPI_MAX_SHMEMS);
! PROC_PRINT(" FIFOs = %i/%i\n", rtapi_data->fifo_count,
! RTAPI_MAX_FIFOS);
! PROC_PRINT(" Semaphores = %i/%i\n", rtapi_data->sem_count,
! RTAPI_MAX_SEMS);
PROC_PRINT(" Interrupts = %i\n", rtapi_data->irq_count);
if (rtapi_data->timer_running) {
***************
*** 108,111 ****
--- 114,149 ----
+ static int proc_read_modules(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+ {
+ int n;
+ char *state_str;
+
+ PROC_PRINT_VARS;
+ MOD_INC_USE_COUNT;
+ PROC_PRINT("******* RTAPI MODULES *******\n");
+ PROC_PRINT("ID Type Name\n");
+ for (n = 1; n <= RTAPI_MAX_MODULES; n++) {
+ if (module_array[n].state != NO_MODULE) {
+ switch (module_array[n].state) {
+ case REALTIME:
+ state_str = "RT ";
+ break;
+ case USERSPACE:
+ state_str = "USER";
+ break;
+ default:
+ state_str = "????";
+ break;
+ }
+ PROC_PRINT("%02d %s %s\n", n, state_str, module_array[n].name);
+ }
+ }
+ PROC_PRINT("\n");
+ MOD_DEC_USE_COUNT;
+ PROC_PRINT_DONE;
+ }
+
+
static int proc_read_tasks(char *page, char **start, off_t off,
int count, int *eof, void *data)
***************
*** 117,121 ****
MOD_INC_USE_COUNT;
PROC_PRINT("******** RTAPI TASKS ********\n");
! PROC_PRINT("ID State Code\n");
for (n = 1; n <= RTAPI_MAX_TASKS; n++) {
if (task_array[n].state != EMPTY) {
--- 155,159 ----
MOD_INC_USE_COUNT;
PROC_PRINT("******** RTAPI TASKS ********\n");
! PROC_PRINT("ID Own Prio State Code\n");
for (n = 1; n <= RTAPI_MAX_TASKS; n++) {
if (task_array[n].state != EMPTY) {
***************
*** 137,141 ****
break;
}
! PROC_PRINT("%02d %s %p\n", n, state_str, task_array[n].taskcode);
}
}
--- 175,180 ----
break;
}
! PROC_PRINT("%02d %02d %3d %s %p\n", n, task_array[n].owner,
! task_array[n].prio, state_str, task_array[n].taskcode);
}
}
***************
*** 156,164 ****
PROC_PRINT("ID Users Key Size\n");
PROC_PRINT(" RT/UL \n");
! for ( n = 1 ; n <= RTAPI_MAX_SHMEMS ; n++ ) {
! if ( shmem_array[n].key != 0 ) {
PROC_PRINT("%02d %2d/%-2d %-10d %-10lu\n",
! n, shmem_array[n].rtusers, shmem_array[n].ulusers,
! shmem_array[n].key, shmem_array[n].size);
}
}
--- 195,203 ----
PROC_PRINT("ID Users Key Size\n");
PROC_PRINT(" RT/UL \n");
! for (n = 1; n <= RTAPI_MAX_SHMEMS; n++) {
! if (shmem_array[n].key != 0) {
PROC_PRINT("%02d %2d/%-2d %-10d %-10lu\n",
! n, shmem_array[n].rtusers, shmem_array[n].ulusers,
! shmem_array[n].key, shmem_array[n].size);
}
}
***************
*** 293,296 ****
--- 332,342 ----
status_file->read_proc = proc_read_status;
+ /* create read only file "/proc/rtapi/modules" */
+ modules_file = create_proc_entry("modules", S_IRUGO, rtapi_dir);
+ if (modules_file == NULL) {
+ return -1;
+ }
+ modules_file->read_proc = proc_read_modules;
+
/* create read only file "/proc/rtapi/tasks" */
tasks_file = create_proc_entry("tasks", S_IRUGO, rtapi_dir);
***************
*** 347,350 ****
--- 393,400 ----
status_file = NULL;
}
+ if (modules_file != NULL) {
+ remove_proc_entry("modules", rtapi_dir);
+ modules_file = NULL;
+ }
if (tasks_file != NULL) {
remove_proc_entry("tasks", rtapi_dir);
***************
*** 372,374 ****
#endif /* CONFIG_PROC_FS */
! #endif /* RTAPI_COMMON_H */
--- 422,424 ----
#endif /* CONFIG_PROC_FS */
! #endif /* RTAPI_PROC_H */
Index: sim_rtapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/sim_rtapi.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sim_rtapi.c 11 Aug 2003 04:58:39 -0000 1.8
--- sim_rtapi.c 24 Aug 2003 09:38:25 -0000 1.9
***************
*** 306,310 ****
! int rtapi_shmem_new(int key, unsigned long int size, rtapi_shmem_handle * shmemptr)
{
rtapi_shmem_handle shmem;
--- 306,311 ----
! int rtapi_shmem_new(int key, unsigned long int size,
! rtapi_shmem_handle * shmemptr)
{
rtapi_shmem_handle shmem;
Index: sim_ulapi.c
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/sim_ulapi.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sim_ulapi.c 11 Aug 2003 04:58:39 -0000 1.4
--- sim_ulapi.c 24 Aug 2003 09:38:25 -0000 1.5
***************
*** 40,44 ****
! int ulapi_shmem_new(int key, unsigned long int size, ulapi_shmem_handle * shmemptr)
{
ulapi_shmem_handle shmem;
--- 40,45 ----
! int ulapi_shmem_new(int key, unsigned long int size,
! ulapi_shmem_handle * shmemptr)
{
ulapi_shmem_handle shmem;
Index: ulapi.h
===================================================================
RCS file: /cvsroot/emc/rtapi/src/rtapi/ulapi.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ulapi.h 20 Aug 2003 03:16:21 -0000 1.9
--- ulapi.h 24 Aug 2003 09:38:25 -0000 1.10
***************
*** 66,81 ****
/** 'ulapi_init() sets up the user space interface to the RTAPI.
! It must be called before calling any ulapi functions. Returns
! a status code, as defined above.
*/
! extern int ulapi_init(void);
/** 'ulapi_exit()' shuts down and cleans up the user space interface
! to the RTAPI. It must be called before program exit. Returns a
! status code.
*/
! extern int ulapi_exit(void);
/***********************************************************************
--- 66,92 ----
/** 'ulapi_init() sets up the user space interface to the RTAPI.
! It must be called before calling any ulapi functions.
! 'modname' can optionally point to a string that identifies
! the module. The string will be truncated at 32 characters.
! If 'modname' is NULL, the system will assign a name.
! On success, returns a positive integer module ID, which is
! used for subsequent calls to ulapi_xxx_new, ulapi_xxx_delete,
! and ulapi_exit. On failure, returns a negative error code as
! defined above.
*/
! extern int ulapi_init(char *modname);
/** 'ulapi_exit()' shuts down and cleans up the user space interface
! to the RTAPI. It must be called prior to exit by any module
! that called ulapi_init. 'module_id' is the ID code returned
! when that module called ulapi_init(). ulapi_exit() may attempt
! to clean up any resources allocated by the module, but should
! not be relied on to replace proper cleanup code within the
! module. Returns a status code.
*/
! extern int ulapi_exit(int module_id);
+ extern void ulapi_printall(void);
/***********************************************************************
***************
*** 85,102 ****
/** 'ulapi_shmem_new()' allocates a block of shared memory. 'key'
identifies the memory block, and must be non-zero. All modules
! wishing to access the same memory must use the same key. The
! block will be at least 'size' bytes, and may be rounded up.
! Allocating many small blocks may be very wasteful. On success,
! it returns a positive integer ID, which is used for all subsequent
! calls dealing with the block. On failure, it returns a negative
! error code.
*/
! extern int ulapi_shmem_new(int key, unsigned long int size );
/** 'ulapi_shmem_delete()' frees the shared memory block associated
! with 'shmem_id'. Returns a status code.
*/
! extern int ulapi_shmem_delete(int shmem_id);
--- 96,115 ----
/** 'ulapi_shmem_new()' allocates a block of shared memory. 'key'
identifies the memory block, and must be non-zero. All modules
! wishing to access the same memory must use the same key.
! 'module_id' is the ID of the module that is making the call
! (see ulapi_init). The block will be at least 'size' bytes,
! and may be rounded up. Allocating many small blocks may be very
! wasteful. On success, it returns a positive integer ID, which is
! used for all subsequent calls dealing with the block. On failure,
! it returns a negative error code.
*/
! extern int ulapi_shmem_new(int key, int module_id, unsigned long int size);
/** 'ulapi_shmem_delete()' frees the shared memory block associated
! with 'shmem_id'. 'module_id' is the ID of the calling module.
! Returns a status code.
*/
! extern int ulapi_shmem_delete(int shmem_id, int module_id);
***************
*** 113,130 ****
/** 'ulapi_fifo_new()' opens a fifo for communication with realtime
code. 'key' identifies the fifo, all modules wishing to access the
! same fifo must use the same key. 'size' is the size of the desired
! fifo. 'mode' is either 'R' or 'W', for readable or writeable fifos.
! On success, returns a positive integer fifo ID to be used for all
! subsequent calls dealing with the fifo. On failure, returns a
! negative error code.
*/
! extern int ulapi_fifo_new(int key, unsigned long int size, char mode );
/** 'ulapi_fifo_delete()' is the counterpart to 'rtapi_fifo_new()'.
! It closes the fifo associated with 'fifo_ID'. 'mode' is the mode
! that was specified when the fifo was created. Returns status code.
*/
! extern int ulapi_fifo_delete(int fifo_id, char mode);
--- 126,145 ----
/** 'ulapi_fifo_new()' opens a fifo for communication with realtime
code. 'key' identifies the fifo, all modules wishing to access the
! same fifo must use the same key. 'module_id' is the ID of the
! module making the call (see rtapi_init). 'size' is the size of
! the desired fifo. 'mode' is either 'R' or 'W', for readable or
! writeable fifos. On success, returns a positive integer fifo ID
! to be used for all subsequent calls dealing with the fifo. On
! failure, returns a negative error code.
*/
! extern int ulapi_fifo_new(int key, int module_id,
! unsigned long int size, char mode);
/** 'ulapi_fifo_delete()' is the counterpart to 'rtapi_fifo_new()'.
! It closes the fifo associated with 'fifo_ID'. 'module_id' is
! the ID of the calling module. Returns a status code.
*/
! extern int ulapi_fifo_delete(int fifo_id, int module_id);
|
|
From: <jmk...@us...> - 2003-08-24 09:38:28
|
Update of /cvsroot/emc/rtapi/examples/watchdog
In directory sc8-pr-cvs1:/tmp/cvs-serv3121/examples/watchdog
Modified Files:
watchdog.c
Log Message:
Added module ID, now rtapi_exit() should remove all items allocated by the module. Added a mutex to protect RTAPI internal data from simultaneous access. Basic testing complete, needs more detailed testing.
Index: watchdog.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/watchdog/watchdog.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** watchdog.c 16 Aug 2003 20:29:39 -0000 1.2
--- watchdog.c 24 Aug 2003 09:38:25 -0000 1.3
***************
*** 63,66 ****
--- 63,67 ----
#endif
+ static int module;
static int hi_task; /* the high priority task ID */
static int lo_task; /* the low priority task ID */
***************
*** 111,142 ****
int retval;
int prio;
rtapi_print_msg(RTAPI_MSG_INFO, "WATCHDOG: Installing watchdog\n");
! if (rtapi_init() != RTAPI_SUCCESS ) {
return -1;
}
! /* set the base timer period */
! retval = rtapi_clock_set_period(TIMER_PERIOD_NSEC);
! if ( retval < 0 ) {
! /* See rtapi.h for the error codes returned */
! rtapi_print_msg( RTAPI_MSG_ERR,
! "watchdog init: rtapi_clock_set_period returned %d\n", retval );
return -1;
}
/* low priority task first */
prio = rtapi_prio_lowest();
! lo_task = rtapi_task_new(lo_code, 0 /* arg */, prio, STACKSIZE, RTAPI_NO_FP );
if ( lo_task < 0 ) {
/* See rtapi.h for the error codes returned */
rtapi_print_msg( RTAPI_MSG_ERR,
"watchdog init: rtapi_task_new(lo) returned %d\n", lo_task );
return -1;
}
/* now the high priority task */
prio = rtapi_prio_highest();
! hi_task = rtapi_task_new(hi_code, 0 /* arg */, prio, STACKSIZE, RTAPI_NO_FP );
if ( hi_task < 0 ) {
rtapi_print_msg( RTAPI_MSG_ERR,
"watchdog init: rtapi_task_new(hi) returned %d\n", hi_task );
return -1;
}
--- 112,164 ----
int retval;
int prio;
+ long int period;
rtapi_print_msg(RTAPI_MSG_INFO, "WATCHDOG: Installing watchdog\n");
! module = rtapi_init("WATCHDOG");
! if ( module < 0 ) {
! rtapi_print( "watchdog init: rtapi_init returned %d\n", module );
return -1;
}
! /* is timer started? if so, what period? */
! period = rtapi_clock_set_period(0);
! if ( period == 0 ) {
! /* not running, start it */
! rtapi_print("watchdog init: starting timer with period %ld\n", TIMER_PERIOD_NSEC);
! period = rtapi_clock_set_period(TIMER_PERIOD_NSEC);
! if (period < 0) {
! rtapi_print("watchdog init: rtapi_clock_set_period failed with %ld\n",
! period);
! rtapi_exit(module);
! return -1;
! }
! }
! /* make sure period <= desired period (allow 1% roundoff error) */
! if ( period > (TIMER_PERIOD_NSEC+(TIMER_PERIOD_NSEC/100))) {
! /* timer period too long */
! rtapi_print("watchdog init: clock period too long: %ld\n", period );
! rtapi_exit(module);
return -1;
}
+ rtapi_print("watchdog init: desired clock %ld, actual %ld\n",
+ TIMER_PERIOD_NSEC, period );
/* low priority task first */
prio = rtapi_prio_lowest();
! lo_task = rtapi_task_new(lo_code, 0 /* arg */, prio, module,
! STACKSIZE, RTAPI_NO_FP );
if ( lo_task < 0 ) {
/* See rtapi.h for the error codes returned */
rtapi_print_msg( RTAPI_MSG_ERR,
"watchdog init: rtapi_task_new(lo) returned %d\n", lo_task );
+ rtapi_exit(module);
return -1;
}
/* now the high priority task */
prio = rtapi_prio_highest();
! hi_task = rtapi_task_new(hi_code, 0 /* arg */, prio, module,
! STACKSIZE, RTAPI_NO_FP );
if ( hi_task < 0 ) {
rtapi_print_msg( RTAPI_MSG_ERR,
"watchdog init: rtapi_task_new(hi) returned %d\n", hi_task );
+ rtapi_exit(module);
return -1;
}
***************
*** 146,149 ****
--- 168,172 ----
rtapi_print_msg( RTAPI_MSG_ERR,
"watchdog init: rtapi_task_start(lo) returned %d\n", retval );
+ rtapi_exit(module);
return -1;
}
***************
*** 152,155 ****
--- 175,179 ----
rtapi_print_msg( RTAPI_MSG_ERR,
"watchdog init: rtapi_task_start(hi) returned %d\n", retval );
+ rtapi_exit(module);
return -1;
}
***************
*** 186,190 ****
"watchdog exit: rtapi_task_delete(lo) returned %d\n", retval );
}
! rtapi_exit();
rtapi_print_msg(RTAPI_MSG_INFO, "WATCHDOG: Watchdog removed.\n");
}
--- 210,214 ----
"watchdog exit: rtapi_task_delete(lo) returned %d\n", retval );
}
! rtapi_exit(module);
rtapi_print_msg(RTAPI_MSG_INFO, "WATCHDOG: Watchdog removed.\n");
}
|
|
From: <jmk...@us...> - 2003-08-24 09:38:28
|
Update of /cvsroot/emc/rtapi/examples/timertask
In directory sc8-pr-cvs1:/tmp/cvs-serv3121/examples/timertask
Modified Files:
timertask.c
Log Message:
Added module ID, now rtapi_exit() should remove all items allocated by the module. Added a mutex to protect RTAPI internal data from simultaneous access. Basic testing complete, needs more detailed testing.
Index: timertask.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/timertask/timertask.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** timertask.c 20 Aug 2003 03:16:21 -0000 1.13
--- timertask.c 24 Aug 2003 09:38:24 -0000 1.14
***************
*** 9,12 ****
--- 9,13 ----
#include "rtapi_app.h" /* rtapi_app_main,exit() */
+ static int module;
static int timer_task; /* the task ID */
static int timer_count = 0; /* the output variable */
***************
*** 38,42 ****
long period;
! if (rtapi_init() != RTAPI_SUCCESS ) {
return -1;
}
--- 39,45 ----
long period;
! module = rtapi_init("TIMERTASK");
! if ( module < 0 ) {
! rtapi_print( "timertask init: rtapi_init returned %d\n", module );
return -1;
}
***************
*** 51,54 ****
--- 54,58 ----
rtapi_print("timertask init: rtapi_clock_set_period failed with %ld\n",
period);
+ rtapi_exit(module);
return -1;
}
***************
*** 58,61 ****
--- 62,66 ----
/* timer period too long */
rtapi_print("timertask init: clock period too long: %ld\n", period );
+ rtapi_exit(module);
return -1;
}
***************
*** 69,77 ****
/* the second arg is an abitrary int that is passed to the timer task
on the first iterration */
! timer_task = rtapi_task_new(timer_code, 0 /* arg */, timer_prio,
TIMER_STACKSIZE, RTAPI_NO_FP );
if ( timer_task < 0 ) {
/* See rtapi.h for the error codes returned */
rtapi_print( "timertask init: rtapi_task_new returned %d\n", timer_task );
return -1;
}
--- 74,83 ----
/* the second arg is an abitrary int that is passed to the timer task
on the first iterration */
! timer_task = rtapi_task_new(timer_code, 0 /* arg */, timer_prio, module,
TIMER_STACKSIZE, RTAPI_NO_FP );
if ( timer_task < 0 ) {
/* See rtapi.h for the error codes returned */
rtapi_print( "timertask init: rtapi_task_new returned %d\n", timer_task );
+ rtapi_exit(module);
return -1;
}
***************
*** 80,83 ****
--- 86,90 ----
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("timertask init: rtapi_task_start returned %d\n", retval );
+ rtapi_exit(module);
return -1;
}
***************
*** 102,106 ****
/* Remove the task from the list */
- /* TESTING - intentionally skip the task_delete */
retval = rtapi_task_delete(timer_task);
if ( retval != RTAPI_SUCCESS ) {
--- 109,112 ----
***************
*** 111,115 ****
rtapi_print("timertask exit: timer count is %d\n", timer_count);
/* Clean up and exit */
! rtapi_exit();
}
--- 117,121 ----
rtapi_print("timertask exit: timer count is %d\n", timer_count);
/* Clean up and exit */
! rtapi_exit(module);
}
|
|
From: <jmk...@us...> - 2003-08-24 09:38:27
|
Update of /cvsroot/emc/rtapi/examples/semaphore
In directory sc8-pr-cvs1:/tmp/cvs-serv3121/examples/semaphore
Modified Files:
master.c slave.c
Log Message:
Added module ID, now rtapi_exit() should remove all items allocated by the module. Added a mutex to protect RTAPI internal data from simultaneous access. Basic testing complete, needs more detailed testing.
Index: master.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/semaphore/master.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** master.c 20 Aug 2003 03:16:20 -0000 1.11
--- master.c 24 Aug 2003 09:38:24 -0000 1.12
***************
*** 11,14 ****
--- 11,15 ----
#include "common.h" /* semaphore key */
+ static int module;
static int master_sem; /* the semaphore ID */
static int master_task; /* the task ID */
***************
*** 38,49 ****
long period;
! if (rtapi_init() != RTAPI_SUCCESS ) {
return -1;
}
/* create the semaphore */
! master_sem = rtapi_sem_new( SEM_KEY );
if ( master_sem < 0 ) {
rtapi_print( "sem master init: rtapi_sem_new returned %d\n", master_sem );
return -1;
}
--- 39,53 ----
long period;
! module = rtapi_init("SEM_MASTER");
! if ( module < 0 ) {
! rtapi_print( "sem master init: rtapi_init returned %d\n", module );
return -1;
}
/* create the semaphore */
! master_sem = rtapi_sem_new( SEM_KEY, module );
if ( master_sem < 0 ) {
rtapi_print( "sem master init: rtapi_sem_new returned %d\n", master_sem );
+ rtapi_exit(module);
return -1;
}
***************
*** 58,61 ****
--- 62,66 ----
rtapi_print("sem master init: rtapi_clock_set_period failed with %ld\n",
period);
+ rtapi_exit(module);
return -1;
}
***************
*** 65,68 ****
--- 70,74 ----
/* timer period too long */
rtapi_print("sem master init: clock period too long: %ld\n", period );
+ rtapi_exit(module);
return -1;
}
***************
*** 75,82 ****
/* create the master task */
! master_task = rtapi_task_new(master_code, 0 /* arg */, master_prio,
MASTER_STACKSIZE, RTAPI_NO_FP );
if ( master_task < 0 ) {
rtapi_print( "sem master init: rtapi_task_new returned %d\n", master_task );
return -1;
}
--- 81,89 ----
/* create the master task */
! master_task = rtapi_task_new(master_code, 0 /* arg */, master_prio, module,
MASTER_STACKSIZE, RTAPI_NO_FP );
if ( master_task < 0 ) {
rtapi_print( "sem master init: rtapi_task_new returned %d\n", master_task );
+ rtapi_exit(module);
return -1;
}
***************
*** 86,89 ****
--- 93,97 ----
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem master init: rtapi_task_start returned %d\n", retval );
+ rtapi_exit(module);
return -1;
}
***************
*** 99,122 ****
int retval;
- /* TESTING - intentionally fail to remove the task and the semaphore */
retval = rtapi_task_pause( master_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem master exit: rtapi_task_stop returned %d\n", retval );
- return;
}
retval = rtapi_task_delete( master_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem master exit: rtapi_task_delete returned %d\n", retval );
- return;
}
! retval = rtapi_sem_delete( master_sem );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem master exit: rtapi_sem_delete returned %d\n", retval );
- return;
}
rtapi_print("sem master exit: master count is %d\n", master_count);
! rtapi_exit();
}
--- 107,126 ----
int retval;
retval = rtapi_task_pause( master_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem master exit: rtapi_task_stop returned %d\n", retval );
}
retval = rtapi_task_delete( master_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem master exit: rtapi_task_delete returned %d\n", retval );
}
! retval = rtapi_sem_delete( master_sem, module );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem master exit: rtapi_sem_delete returned %d\n", retval );
}
rtapi_print("sem master exit: master count is %d\n", master_count);
! rtapi_exit(module);
}
Index: slave.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/semaphore/slave.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** slave.c 14 Aug 2003 04:08:26 -0000 1.8
--- slave.c 24 Aug 2003 09:38:24 -0000 1.9
***************
*** 11,14 ****
--- 11,15 ----
#include "common.h" /* semaphore key */
+ static int module;
static int slave_sem; /* the semaphore ID */
static int slave_task; /* the task ID */
***************
*** 34,45 ****
int slave_prio;
! if (rtapi_init() != RTAPI_SUCCESS ) {
return -1;
}
/* open the semaphore */
! slave_sem = rtapi_sem_new( SEM_KEY );
if ( slave_sem < 0 ) {
rtapi_print( "sem slave init: rtapi_sem_new returned %d\n", slave_sem );
return -1;
}
--- 35,49 ----
int slave_prio;
! module = rtapi_init("SEM_SLAVE");
! if ( module < 0 ) {
! rtapi_print( "sem slave init: rtapi_init returned %d\n", module );
return -1;
}
/* open the semaphore */
! slave_sem = rtapi_sem_new( SEM_KEY, module );
if ( slave_sem < 0 ) {
rtapi_print( "sem slave init: rtapi_sem_new returned %d\n", slave_sem );
+ rtapi_exit(module);
return -1;
}
***************
*** 49,56 ****
/* create the slave task */
! slave_task = rtapi_task_new(slave_code, 0 /* arg */, slave_prio,
SLAVE_STACKSIZE, RTAPI_NO_FP );
if ( slave_task < 0 ) {
rtapi_print( "sem slave init: rtapi_task_new returned %d\n", slave_task );
return -1;
}
--- 53,61 ----
/* create the slave task */
! slave_task = rtapi_task_new(slave_code, 0 /* arg */, slave_prio, module,
SLAVE_STACKSIZE, RTAPI_NO_FP );
if ( slave_task < 0 ) {
rtapi_print( "sem slave init: rtapi_task_new returned %d\n", slave_task );
+ rtapi_exit(module);
return -1;
}
***************
*** 60,63 ****
--- 65,69 ----
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem slave init: rtapi_task_start returned %d\n", retval );
+ rtapi_exit(module);
return -1;
}
***************
*** 76,94 ****
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem slave exit: rtapi_task_stop returned %d\n", retval );
- return;
}
retval = rtapi_task_delete( slave_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem slave exit: rtapi_task_delete returned %d\n", retval );
- return;
}
! retval = rtapi_sem_delete( slave_sem );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem slave exit: rtapi_sem_delete returned %d\n", retval );
- return;
}
rtapi_print("sem slave exit: slave count is %d\n", slave_count);
! rtapi_exit();
}
--- 82,97 ----
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem slave exit: rtapi_task_stop returned %d\n", retval );
}
retval = rtapi_task_delete( slave_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem slave exit: rtapi_task_delete returned %d\n", retval );
}
! retval = rtapi_sem_delete( slave_sem, module );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("sem slave exit: rtapi_sem_delete returned %d\n", retval );
}
rtapi_print("sem slave exit: slave count is %d\n", slave_count);
! rtapi_exit(module);
}
|
|
From: <jmk...@us...> - 2003-08-24 09:38:27
|
Update of /cvsroot/emc/rtapi/examples/extint
In directory sc8-pr-cvs1:/tmp/cvs-serv3121/examples/extint
Modified Files:
extint.c
Log Message:
Added module ID, now rtapi_exit() should remove all items allocated by the module. Added a mutex to protect RTAPI internal data from simultaneous access. Basic testing complete, needs more detailed testing.
Index: extint.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/extint/extint.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** extint.c 5 Aug 2003 03:51:00 -0000 1.3
--- extint.c 24 Aug 2003 09:38:24 -0000 1.4
***************
*** 12,15 ****
--- 12,16 ----
#define PARPORT_IRQ 7
+ static int module = 0; /* the module ID */
static int timer_count = 0; /* the output variable */
***************
*** 27,39 ****
int retval;
! /* set up ISR */
! retval = rtapi_free_interrupt_handler(PARPORT_IRQ);
! if ( retval != RTAPI_SUCCESS ) {
! rtapi_print("extint init: rtapi_free_interrupt returned %d\n", retval );
! /*return -1;*/
}
! retval = rtapi_assign_interrupt_handler(PARPORT_IRQ, parport_irq_handler);
if ( retval != RTAPI_SUCCESS ) {
! rtapi_print("extint init: rtapi_assign_interrupt_handler returned %d\n", retval );
return -1;
}
--- 28,40 ----
int retval;
! module = rtapi_init("EXTINT");
! if ( module != RTAPI_SUCCESS ) {
! rtapi_print("extint init: rtapi_init returned %d\n", module );
! return -1;
}
! /* set up ISR */
! retval = rtapi_irq_new(PARPORT_IRQ, module, parport_irq_handler);
if ( retval != RTAPI_SUCCESS ) {
! rtapi_print("extint init: rtapi_irq_new returned %d\n", retval );
return -1;
}
***************
*** 62,72 ****
/* clear ISR */
retval = rtapi_disable_interrupt(PARPORT_IRQ);
! if ( retval != RTAPI_SUCCESS ) {
rtapi_print("extint exit: rtapi_disable_interrupt returned %d\n", retval );
return;
}
! retval = rtapi_free_interrupt_handler(PARPORT_IRQ);
if ( retval != RTAPI_SUCCESS ) {
! rtapi_print("extint exit: rtapi_disable_interrupt returned %d\n", retval );
return;
}
--- 63,73 ----
/* clear ISR */
retval = rtapi_disable_interrupt(PARPORT_IRQ);
! if ( retval < 0 ) {
rtapi_print("extint exit: rtapi_disable_interrupt returned %d\n", retval );
return;
}
! retval = rtapi_irq_delete(PARPORT_IRQ);
if ( retval != RTAPI_SUCCESS ) {
! rtapi_print("extint exit: rtapi_irq_delete returned %d\n", retval );
return;
}
***************
*** 74,77 ****
rtapi_print("extint exit: interrupt count is %d\n", timer_count);
! /* rtapi_app_return(); */
}
--- 75,82 ----
rtapi_print("extint exit: interrupt count is %d\n", timer_count);
! retval = rtapi_exit(module);
! if ( retval != RTAPI_SUCCESS ) {
! rtapi_print("extint exit: rtapi_exit returned %d\n", retval );
! return;
! }
}
|
|
From: <jmk...@us...> - 2003-08-24 09:38:27
|
Update of /cvsroot/emc/rtapi/examples/fifo
In directory sc8-pr-cvs1:/tmp/cvs-serv3121/examples/fifo
Modified Files:
fifotask.c fifousr.c
Log Message:
Added module ID, now rtapi_exit() should remove all items allocated by the module. Added a mutex to protect RTAPI internal data from simultaneous access. Basic testing complete, needs more detailed testing.
Index: fifotask.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/fifo/fifotask.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** fifotask.c 20 Aug 2003 03:16:20 -0000 1.16
--- fifotask.c 24 Aug 2003 09:38:24 -0000 1.17
***************
*** 9,12 ****
--- 9,13 ----
#include "common.h" /* FIFO_KEY */
+ static int module; /* the module ID */
static int fifo_task; /* the task ID */
static int fifo; /* the fifo ID */
***************
*** 59,72 ****
long period;
! if (rtapi_init() != RTAPI_SUCCESS ) {
return -1;
}
- retval = -1;
/* allocate and initialize the fifo */
! fifo = rtapi_fifo_new(FIFO_KEY, FIFO_SIZE, 'W');
if (fifo < 0 ) {
rtapi_print("fifotask init: rtapi_fifo_new failed with %d\n", fifo);
! goto no_fifo;
}
--- 60,75 ----
long period;
! module = rtapi_init("FIFOTASK");
! if ( module < 0 ) {
! rtapi_print("fifotask init: rtapi_init failed with %d\n", module);
return -1;
}
/* allocate and initialize the fifo */
! fifo = rtapi_fifo_new(FIFO_KEY, module, FIFO_SIZE, 'W');
if (fifo < 0 ) {
rtapi_print("fifotask init: rtapi_fifo_new failed with %d\n", fifo);
! rtapi_exit(module);
! return -1;
}
***************
*** 82,86 ****
rtapi_print("fifotask init: rtapi_clock_set_period failed with %ld\n",
period);
! goto no_task;
}
}
--- 85,90 ----
rtapi_print("fifotask init: rtapi_clock_set_period failed with %ld\n",
period);
! rtapi_exit(module);
! return -1;
}
}
***************
*** 89,93 ****
/* timer period too long */
rtapi_print("fifotask init: clock period too long: %ld\n", period );
! goto no_task;
}
rtapi_print("fifotask init: desired clock %ld, actual %ld\n",
--- 93,98 ----
/* timer period too long */
rtapi_print("fifotask init: clock period too long: %ld\n", period );
! rtapi_exit(module);
! return -1;
}
rtapi_print("fifotask init: desired clock %ld, actual %ld\n",
***************
*** 98,106 ****
/* create the fifo task */
! fifo_task = rtapi_task_new(fifo_code, 0 /* arg */, fifo_prio,
FIFO_STACKSIZE, RTAPI_NO_FP );
if (fifo_task < 0) {
rtapi_print("fifotask init: rtapi_task_new failed with %d\n", fifo_task);
! goto no_task;
}
--- 103,112 ----
/* create the fifo task */
! fifo_task = rtapi_task_new(fifo_code, 0 /* arg */, fifo_prio, module,
FIFO_STACKSIZE, RTAPI_NO_FP );
if (fifo_task < 0) {
rtapi_print("fifotask init: rtapi_task_new failed with %d\n", fifo_task);
! rtapi_exit(module);
! return -1;
}
***************
*** 109,113 ****
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask init: rtapi_task_start failed with %d\n", retval);
! goto no_start;
}
--- 115,120 ----
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask init: rtapi_task_start failed with %d\n", retval);
! rtapi_exit(module);
! return -1;
}
***************
*** 115,126 ****
return 0;
-
- /* clean up after failures so that the rtapi can be removed cleanly */
- no_start:
- rtapi_task_delete(fifo_task);
- no_task:
- rtapi_fifo_delete(fifo, 'W');
- no_fifo:
- return retval;
}
--- 122,125 ----
***************
*** 139,144 ****
rtapi_print("fifotask exit: rtapi_task_delete failed with %d\n", retval);
}
! /* TESTING - Intentionally fail to delete fifo */
! retval = rtapi_fifo_delete(fifo, 'W');
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask exit: rtapi_fifo_delete failed with %d\n", retval);
--- 138,143 ----
rtapi_print("fifotask exit: rtapi_task_delete failed with %d\n", retval);
}
!
! retval = rtapi_fifo_delete(fifo, module);
if (retval != RTAPI_SUCCESS) {
rtapi_print("fifotask exit: rtapi_fifo_delete failed with %d\n", retval);
***************
*** 147,150 ****
rtapi_print("fifotask exit: done\n");
! rtapi_exit();
}
--- 146,149 ----
rtapi_print("fifotask exit: done\n");
! rtapi_exit(module);
}
Index: fifousr.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/fifo/fifousr.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** fifousr.c 20 Aug 2003 03:16:20 -0000 1.6
--- fifousr.c 24 Aug 2003 09:38:24 -0000 1.7
***************
*** 11,14 ****
--- 11,15 ----
#include "common.h" /* FIFO_KEY, FIFO_SIZE */
+ static int module;
static jmp_buf env;
static void quit(int sig)
***************
*** 24,37 ****
int retval;
! retval = ulapi_init();
! if (retval != ULAPI_SUCCESS) {
! printf("fifousr main: ulapi_init returned %d\n", retval);
return -1;
}
/* open the fifo */
! fifo = ulapi_fifo_new(FIFO_KEY, FIFO_SIZE, 'R');
if (fifo < 0) {
printf("fifousr main: ulapi_fifo_new returned %d\n", fifo);
return -1;
}
--- 25,39 ----
int retval;
! module = ulapi_init("FIFO_USR");
! if (module < 0) {
! printf("fifousr main: ulapi_init returned %d\n", module);
return -1;
}
/* open the fifo */
! fifo = ulapi_fifo_new(FIFO_KEY, module, FIFO_SIZE, 'R');
if (fifo < 0) {
printf("fifousr main: ulapi_fifo_new returned %d\n", fifo);
+ ulapi_exit(module);
return -1;
}
***************
*** 57,66 ****
printf("shutting down\n");
! retval = ulapi_fifo_delete(fifo, 'R');
if (retval != ULAPI_SUCCESS) {
printf("fifousr main: ulapi_fifo_delete returned %d\n", retval);
return -1;
}
! return ulapi_exit();
}
--- 59,69 ----
printf("shutting down\n");
! retval = ulapi_fifo_delete(fifo, module);
if (retval != ULAPI_SUCCESS) {
printf("fifousr main: ulapi_fifo_delete returned %d\n", retval);
+ ulapi_exit(module);
return -1;
}
! return ulapi_exit(module);
}
|
|
From: <jmk...@us...> - 2003-08-24 09:38:27
|
Update of /cvsroot/emc/rtapi/examples/shmem
In directory sc8-pr-cvs1:/tmp/cvs-serv3121/examples/shmem
Modified Files:
shmemtask.c shmemusr.c
Log Message:
Added module ID, now rtapi_exit() should remove all items allocated by the module. Added a mutex to protect RTAPI internal data from simultaneous access. Basic testing complete, needs more detailed testing.
Index: shmemtask.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/shmem/shmemtask.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** shmemtask.c 20 Aug 2003 03:16:20 -0000 1.10
--- shmemtask.c 24 Aug 2003 09:38:24 -0000 1.11
***************
*** 9,12 ****
--- 9,13 ----
#include "common.h" /* shmem structure, SHMEM_KEY */
+ static int module;
static int shmem_task; /* the task ID*/
static int shmem_mem; /* the shared memory ID */
***************
*** 38,49 ****
long period;
! if (rtapi_init() != RTAPI_SUCCESS ) {
return -1;
}
-
/* 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;
}
--- 39,52 ----
long period;
! module = rtapi_init("SHMEMTASK");
! if ( module < 0 ) {
! rtapi_print( "shmemtask init: rtapi_init returned %d\n", module );
return -1;
}
/* allocate and initialize the shared memory structure */
! shmem_mem = rtapi_shmem_new( key, module, sizeof(SHMEM_STRUCT) );
if ( shmem_mem < 0 ) {
rtapi_print( "shmemtask init: rtapi_shmem_new returned %d\n", shmem_mem );
+ rtapi_exit(module);
return -1;
}
***************
*** 51,54 ****
--- 54,58 ----
if ( retval != RTAPI_SUCCESS ) {
rtapi_print( "shmemtask init: rtapi_shmem_getptr returned %d\n", retval );
+ rtapi_exit(module);
return -1;
}
***************
*** 65,68 ****
--- 69,73 ----
rtapi_print("shmemtask init: rtapi_clock_set_period failed with %ld\n",
period);
+ rtapi_exit(module);
return -1;
}
***************
*** 72,75 ****
--- 77,81 ----
/* timer period too long */
rtapi_print("shmemtask init: clock period too long: %ld\n", period );
+ rtapi_exit(module);
return -1;
}
***************
*** 81,88 ****
/* create the shmem task */
! shmem_task = rtapi_task_new(shmem_code, 0 /* arg */, shmem_prio,
SHMEM_STACKSIZE, RTAPI_NO_FP );
if ( shmem_task < 0 ) {
rtapi_print( "shmemtask init: rtapi_task_new returned %d\n", shmem_task );
return -1;
}
--- 87,95 ----
/* create the shmem task */
! shmem_task = rtapi_task_new(shmem_code, 0 /* arg */, shmem_prio, module,
SHMEM_STACKSIZE, RTAPI_NO_FP );
if ( shmem_task < 0 ) {
rtapi_print( "shmemtask init: rtapi_task_new returned %d\n", shmem_task );
+ rtapi_exit(module);
return -1;
}
***************
*** 92,95 ****
--- 99,103 ----
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("shmemtask init: rtapi_task_start returned %d\n", retval );
+ rtapi_exit(module);
return -1;
}
***************
*** 112,129 ****
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("shmemtask exit: rtapi_task_stop returned %d\n", retval );
- return;
}
retval = rtapi_task_delete( shmem_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("shmemtask exit: rtapi_task_delete returned %d\n", retval );
- return;
}
! /* TESTING - intentionally skip the shmem_delete */
! retval = rtapi_shmem_delete( shmem_mem );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("shmemtask exit: rtapi_shmem_delete returned %d\n", retval );
- return;
}
/* Clean up and exit */
! rtapi_exit();
}
--- 120,133 ----
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("shmemtask exit: rtapi_task_stop returned %d\n", retval );
}
retval = rtapi_task_delete( shmem_task );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("shmemtask exit: rtapi_task_delete returned %d\n", retval );
}
! retval = rtapi_shmem_delete( shmem_mem, module );
if ( retval != RTAPI_SUCCESS ) {
rtapi_print("shmemtask exit: rtapi_shmem_delete returned %d\n", retval );
}
/* Clean up and exit */
! rtapi_exit(module);
}
Index: shmemusr.c
===================================================================
RCS file: /cvsroot/emc/rtapi/examples/shmem/shmemusr.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** shmemusr.c 20 Aug 2003 03:16:20 -0000 1.3
--- shmemusr.c 24 Aug 2003 09:38:24 -0000 1.4
***************
*** 5,8 ****
--- 5,9 ----
#include "common.h" /* shmem structure */
+ static int module;
static int key = SHMEM_KEY;
static int shmem_id;
***************
*** 19,32 ****
int retval;
! retval = ulapi_init();
! if ( retval != ULAPI_SUCCESS ) {
! printf("shmemusr main: ulapi_init returned %d\n", retval );
return -1;
}
/* allocate the shared memory structure */
! shmem_id = ulapi_shmem_new( key, sizeof(SHMEM_STRUCT) );
if (shmem_id < 0) {
printf( "shmemusr main: ulapi_shmem_new returned %d\n", shmem_id );
return -1;
}
--- 20,35 ----
int retval;
! module = ulapi_init("SHMEM_USR");
! if (module < 1) {
! printf("shmemusr main: ulapi_init returned %d\n", module);
return -1;
}
+
/* allocate the shared memory structure */
! shmem_id = ulapi_shmem_new( key, module, sizeof(SHMEM_STRUCT) );
if (shmem_id < 0) {
printf( "shmemusr main: ulapi_shmem_new returned %d\n", shmem_id );
+ ulapi_exit(module);
return -1;
}
***************
*** 34,37 ****
--- 37,41 ----
if (retval != ULAPI_SUCCESS) {
printf( "shmemusr main: ulapi_shmem_getptr returned %d\n", retval );
+ ulapi_exit(module);
return -1;
}
***************
*** 40,52 ****
while (!done) {
printf("%lu\n", shmem_struct->heartbeat);
sleep(1);
}
! retval = ulapi_shmem_delete( shmem_id );
if (retval != ULAPI_SUCCESS) {
printf("shmemusr main: ulapi_free_shmem returned %d\n", retval );
return -1;
}
! return ulapi_exit();
}
--- 44,58 ----
while (!done) {
printf("%lu\n", shmem_struct->heartbeat);
+ ulapi_printall();
sleep(1);
}
! retval = ulapi_shmem_delete( shmem_id, module );
if (retval != ULAPI_SUCCESS) {
printf("shmemusr main: ulapi_free_shmem returned %d\n", retval );
+ ulapi_exit(module);
return -1;
}
! return ulapi_exit(module);
}
|