EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Tornado
From: [email protected] (Jim B. Kowalkowski)
To: [email protected], [email protected]
Date: Mon, 27 Nov 1995 13:21:03 -0600
> Subject: Tornado

> Some recent email on the subject of Tornoda indicates that both CEBAF
> and LBL will upgrade to Tornado.  It was also indicated that the intent
> is not to use the C++ classes which would make portability and future
> EPICS development dependent on purchasing these classes.  Steve Lewis
> indicated in his notes on Tornado that the Wind Foundation Classes,
> which include iostream, Rogue Wave's tools.h++, Booch classes and
> various wrapper classes are unbundled products. Is there a policy that
> none of these classes would be required for future EPICS enhancements?

We (John and I) believe that increasing are dependancies on proprietary
tools and libraries is probably not in our best interest.

> 
> I am unclear as to the role of the Tornado bundled C++ global
> constructors/desctructors.  Are these used by the Tornado agent only?

Here is a non-Tornado solution to the global constructors/destructors
problem mentioned in the Tornado discussions.  This code allows a user to
load GNU g++ compiled object files. It handles global constructors
and provides global new and delete operators.  Hopefully this was not a
big incentive to upgrade to Tornado.

Jim and John

-----------------------------------------------------------------------------

#include <vxWorks.h>
#include <vme.h>

#include <stdio.h>
#include <symLib.h>
#include <ioLib.h>
#include <sysSymTbl.h>
#include <sysLib.h>
#include <moduleLib.h>
#include <usrLib.h>
#include <a_out.h>

#ifdef __cplusplus
extern "C" {
#endif

void cpp_main(void);
MODULE_ID ldpp (int syms, BOOL noAbort, char *name);
void* __builtin_new(int sz);
void __builtin_delete (void *ptr);

#ifdef __cplusplus
}
#endif

typedef void (*func_ptr) (void);

/* ------------------------------------------------------------------ */
/*
	C++ loader for vxWorks, it runs constructors and such
*/
/* ------------------------------------------------------------------ */

MODULE_ID ldpp (int syms, BOOL noAbort, char *name)
{
  MODULE_ID ret;

  ret = ld(syms,noAbort,name);
  if(ret) cpp_main();
  return ret;
}

void cpp_main(void)
{
	SYM_TYPE stype;
	func_ptr p;
	func_ptr *ctorlist;
	int i;

	if( symFindByName(sysSymTbl,"___CTOR_LIST__",
			(char**)&ctorlist,&stype)==ERROR)
	{
		return;
	}
	else
	{
		for(i=1;ctorlist[i]; i++)
		{
			p=ctorlist[i];
			(*p)();
		}
	}

	if(symRemove(sysSymTbl,"___CTOR_LIST__",stype)==ERROR)
	{
		printf("ctor list just diappeared! - that sucks.\n");
	}

	return;
}

void* __builtin_new(int sz)
{
	void* p;

	if(sz==0) sz=1;

	p=(void*)malloc(sz);

	return p;
}

void __builtin_delete (void *ptr)
{
	if(ptr) free(ptr);
}


Navigate by Date:
Prev: Re: watson
Next: Master EPICS source tree and ASCII file changes Marty Kraimer
Index: 1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Tornado Steve Lewis
Next: Driver support for Sony-Tektronix ET-488. Noboru Yamamoto
Index: 1994  <19951996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·