Unify Framework Lib 1.6.0
The Contiki program loader

Files

file  loader.h
 

Macros

#define LOADER_OK   0
 
#define LOADER_ERR_READ   1
 
#define LOADER_ERR_HDR   2
 
#define LOADER_ERR_OS   3
 
#define LOADER_ERR_FMT   4
 
#define LOADER_ERR_MEM   5
 
#define LOADER_ERR_OPEN   6
 
#define LOADER_ERR_ARCH   7
 
#define LOADER_ERR_VERSION   8
 
#define LOADER_ERR_NOLOADER   9
 
#define LOADER_LOAD(name, arg)   LOADER_ERR_NOLOADER
 
#define LOADER_UNLOAD()
 
#define LOADER_LOAD_DSC(name)   NULL
 
#define LOADER_UNLOAD_DSC(dsc)
 

Detailed Description

The Contiki program loader is an abstract interface for loading and starting programs.

Macro Definition Documentation

◆ LOADER_ERR_ARCH

#define LOADER_ERR_ARCH   7

Wrong architecture.

◆ LOADER_ERR_FMT

#define LOADER_ERR_FMT   4

Data format error.

◆ LOADER_ERR_HDR

#define LOADER_ERR_HDR   2

Header error.

◆ LOADER_ERR_MEM

#define LOADER_ERR_MEM   5

Not enough memory.

◆ LOADER_ERR_NOLOADER

#define LOADER_ERR_NOLOADER   9

Program loading not supported.

◆ LOADER_ERR_OPEN

#define LOADER_ERR_OPEN   6

Could not open file.

◆ LOADER_ERR_OS

#define LOADER_ERR_OS   3

Wrong OS.

◆ LOADER_ERR_READ

#define LOADER_ERR_READ   1

Read error.

◆ LOADER_ERR_VERSION

#define LOADER_ERR_VERSION   8

Wrong OS version.

◆ LOADER_LOAD

#define LOADER_LOAD (   name,
  arg 
)    LOADER_ERR_NOLOADER

Load and execute a program.

This macro is used for loading and executing a program, and requires support from the architecture dependent code. The actual program loading is made by architecture specific functions.

Note
A program loaded with LOADER_LOAD() must call the LOADER_UNLOAD() function to unload itself.
Parameters
nameThe name of the program to be loaded.
argA pointer argument that is passed to the program.
Returns
A loader error, or LOADER_OK if loading was successful.

◆ LOADER_LOAD_DSC

#define LOADER_LOAD_DSC (   name)    NULL

Load a DSC (program description).

Loads a DSC (program description) into memory and returns a pointer to the dsc.

Returns
A pointer to the DSC or NULL if it could not be loaded.

◆ LOADER_OK

#define LOADER_OK   0

No error.

◆ LOADER_UNLOAD

#define LOADER_UNLOAD ( )

Unload a program from memory.

This macro is used for unloading a program and deallocating any memory that was allocated during the loading of the program. This function must be called by the program itself.

◆ LOADER_UNLOAD_DSC

#define LOADER_UNLOAD_DSC (   dsc)

Unload a DSC (program description).

Unload a DSC from memory and deallocate any memory that was allocated when it was loaded.