RTEMS
5.1
|
RTEMS Application Loader. More...
#include <pthread.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <rtems/libio_.h>
#include <dlfcn.h>
#include <rtems/rtl/rap.h>
#include <rtems/rtl/rtl.h>
#include "rtl-find-file.h"
Data Structures | |
struct | rtems_rap_data_s |
struct | rtems_rap_app |
Macros | |
#define | RTL_ENTRY_POINT "_rtems" |
Typedefs | |
typedef struct rtems_rap_data_s | rtems_rap_data |
typedef struct rtems_rap_app | rtems_rap_app |
typedef int(* | rtems_rap_entry) (int argc, const char *argv[]) |
Functions | |
bool | rtems_rap_load (const char *name, int mode, int argc, const char *argv[]) |
bool | rtems_rap_unload (const char *name) |
void * | rtems_rap_find (const char *name) |
bool | rtems_rap_iterate (rtems_rap_iterator iterator) |
const char * | rtems_rap_name (void *handle) |
void * | rtems_rap_dl_handle (void *handle) |
int | rtems_rap_get_error (char *message, size_t max_message) |
RTEMS Application Loader.
This is the RAP implementation.
#define RTL_ENTRY_POINT "_rtems" |
RTL entry.
typedef struct rtems_rap_app rtems_rap_app |
The RAP file data. This structure is allocated on the heap when a file is loaded.
typedef struct rtems_rap_data_s rtems_rap_data |
The global RAP data. This structure is allocated on the heap when the first call to location an application and is never released.
typedef int(* rtems_rap_entry) (int argc, const char *argv[]) |
RAP entry call signature.
void* rtems_rap_dl_handle | ( | void * | handle | ) |
Return the DL handle used to load the module given the RAP handle.
handle | The module handle. |
void* rtems_rap_find | ( | const char * | name | ) |
Find the application handle given a file name.
name | The name of the application file. It can be absolute or relative. Relative names can the basename with an extension. |
NULL | No application file with that name found. |
int rtems_rap_get_error | ( | char * | message, |
size_t | max_message | ||
) |
Get the last error message clearing it. This call is not thread safe is multiple threads are loading object files at the same time. This call follows the model provided by the dlopen family of calls.
message | Pointer to a buffer to copy the message into. |
max_message | The maximum message that can be copied. |
bool rtems_rap_iterate | ( | rtems_rap_iterator | iterator | ) |
Run an iterator over the modules calling the iterator function.
iterator | The iterator function. |
true | The iterator function returned did not return false. |
false | The iterator function returned false.. |
bool rtems_rap_load | ( | const char * | name, |
int | mode, | ||
int | argc, | ||
const char * | argv[] | ||
) |
Load an application.
name | The name of the application file. |
const char* rtems_rap_name | ( | void * | handle | ) |
Return the name of the module given a handle.
handle | The module handle. |
bool rtems_rap_unload | ( | const char * | name | ) |
Unload an application.
obj | The application descriptor. |
true | The application file has been unloaded. |
false | The application could not be unloaded. |