Ejemplo n.º 1
0
// this is our main function (a simpler version of what is in main.cpp)
int main(int argc, char *argv[])
{int k = 1, i = 3, j = 3;
  printf("==== call main argc = %d, argv[1] = %s ==== \n",argc,argv[1]);
  if ((argc > 3) && (equal_string("-s",argv[1]) == CTRUE))
    { i = atoi(argv[2]); j = atoi(argv[3]);  k = 4;
      if ((i < 0) || (i > 10) || (j < 0) || (j > 10)) exit(1);
      printf("increasing memory size by 2^%d and 2^%d \n",i,j);}
 {int t1,t2;
  ClAlloc = new ClaireAllocation;
  ClAlloc->logList = 18 + i;
  ClAlloc->maxList = (1 << (18 + i));
  ClAlloc->maxSize = (2 << (18 + i));
  ClAlloc->maxGC = 20000 * (1 << j);
  ClAlloc->maxStack = 8000 * (1 << j);                   // <yc> 9/98 changed because of GC
  ClAlloc->maxHist = 10000 * (1 << j);
  ClAlloc->maxEnv = 400 * (1 << j);
  ClAlloc->maxHash = ((1 << (11 + i)) + 200);            // <yc> 7/98 Changed for claire3 !
  ClAlloc->hashMask = ((1 << (11 + i)) - 1);
  ClAlloc->stdOut = ClairePort::make(stdout);
  ClAlloc->stdIn = ClairePort::make(stdin);
  ClAlloc->stdErr = ClairePort::make(stdout);
  ClaireResource::run();
  ClEnv->params = C_to_Claire(argc,argv);
  call_main();
  CL_exit(2);
  return 1;}}
Ejemplo n.º 2
0
int main(void)
{

	printf("main\n");
	call_main(g--);

	printf("main over\n");
	
}
Ejemplo n.º 3
0
int main(int argc, char **argv)
{
	char *binary = "binary";
	char binary_buf[64];

	Obj_Entry *objp;
	func_ptr_type exit_proc;

	int fd = open(binary, O_RDONLY);

	/* find file name of file descriptor */
	if (!find_binary_name(fd, binary_buf, sizeof(binary_buf)))
		binary = binary_buf;

	/* build dummy stack */
	void *sp =  setup_stack(binary, (long)fd);

	/* DEBUGGING
	printf("Starting ldso ...\n");
	*/

	/* this is usually '_start' */
	func_ptr_type main_func = _rtld(sp, &exit_proc, &objp);

	/* DEBUGGING
	char **p;
	for(p = environ; *p; p++)
		printf("env: %s\n", *p);
	
	printf("Starting application ... environ: %p\n", lx_environ);
	*/

	/* start loaded application */
	call_main(main_func);

	exit_proc();

	printf("Exiting ldso\n");
	return 0;
}
Ejemplo n.º 4
0
int main()
{
	call_main();
	return 0;
}