Moved export stuff to rldexport.c, rldexport_init() is now also called.

Cleanups.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2431 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2003-01-12 16:48:09 +00:00
parent 0119ceeb8e
commit f351df0829
2 changed files with 11 additions and 36 deletions

View File

@ -3,55 +3,29 @@
** Distributed under the terms of the NewOS License.
*/
#include <string.h>
#include <syscalls.h>
#include <user_runtime.h>
#include "rld_priv.h"
static struct rld_export_t exports=
{
/*
* Unix like stuff
*/
export_dl_open,
export_dl_close,
export_dl_sym,
/*
* BeOS like stuff
*/
export_load_addon,
export_unload_addon,
export_addon_symbol
};
int
rldmain(void *arg)
rldmain(void *_args)
{
int retval;
unsigned long entry;
struct uspace_prog_args_t *uspa= (struct uspace_prog_args_t *)arg;
struct uspace_program_args *args = (struct uspace_program_args *)_args;
void *entry = 0;
rldheap_init();
entry= 0;
rldexport_init(args);
rldelf_init(args);
uspa->rld_export= &exports;
load_program(args->program_path, &entry);
rldelf_init(uspa);
load_program(uspa->prog_path, (void**)&entry);
if(entry) {
retval= ((int(*)(void*))(entry))(uspa);
} else {
if (entry == NULL)
return -1;
}
return retval;
// call the program entry point (usually main())
return ((int (*)(void *))entry)(args);
}

View File

@ -5,6 +5,7 @@
#include "rld_priv.h"
int RLD_STARTUP(void *args)
{
#if DEBUG_RLD