Esempio n. 1
0
/** Start the GridLAB-D simulation executive
	\verbatim gl('start') \endverbatim
 **/
void cmex_start(int nlhs, mxArray *plhs[], /**< () */
				  int nrhs, const mxArray *prhs[] ) /**< () */
{
	global_keep_progress = 1;
	if (exec_start()==FAILED)
		output_error("Simulation failed!");
	return;
}
Esempio n. 2
0
int
execv(const char *path, char *const argv[])
{
	// We'll build the new program in child 0,
	// which never represents a forked child since 0 is an invalid pid.
	// First clear out the new program's entire address space.
	sys_put(SYS_ZERO, 0, NULL, NULL, (void*)VM_USERLO, VM_USERHI-VM_USERLO);

	// Load the ELF executable into child 0.
	if (exec_readelf(path) < 0)
		return -1;

	// Setup child 0's stack with the argument array.
	intptr_t esp = exec_copyargs(argv);

	// Copy our Unix file system and process state into the child.
	sys_put(SYS_COPY, 0, NULL, (void*)VM_FILELO, (void*)VM_FILELO,
		VM_FILEHI-VM_FILELO);

	// Copy child 0's entire memory state onto ours
	// and start the new program.  See lib/entry.S for details.
	exec_start(esp);
}
Esempio n. 3
0
bool elfexec_start(struct elfexec *holder) {
    return exec_start(holder->priv_cookie);
}