Changes in APIs

New PxHndcall variants

The PXROS-HR handler call in the ARM version can be done using either of the below two APIs based on the number of arguments to be passed to the handler.

_PxHndcallPxArg

_PxHndcallPxArg calls the passed function handler with one argument.

Code 1. _PxHndcallPxArg
PxArg_t _PxHndcallPxArg (f, arg);

_PxHndcallVA

_PxHndcallVA calls the passed variadic function handler with its arguments.

Code 2. _PxHndcallPxArg
PxArg_t _PxHndcallVA (handler, parms...);

New PxIntInitVectab and PxTrapInitVectab functions

In the TriCore PXROS-HR version, the interrupt and trap system was completely initialized by the PxInit function. There is no need for user-specific customization of the interrupt and trap system.

In the ARM PXROS-HR version, to relax the hardware-related dependency of the low-level interrupt/trap system, new functions PxIntInitVectab and PxTrapInitVectab have been exposed to the user. These functions must be called before PxInit, with the arguments being the pointers to user-defined functions for installing PXROS-HR interrupt and trap handlers.

These user-defined functions are usually part of BSP (Board Support Package). Their prototypes can be found in pxdef.h.

Code 3. PxIntInitVectab
void PxIntInitVectab(
    PxInt_t maxintno,
    ArmInstallExceptionHandler_t InstallInterruptHandler,
    ArmInstallExceptionHandler_t InstallTrapHandler
    );
Code 4. PxTrapInitVectab
void PxTrapInitVectab(
    ArmInstallExceptionHandler_t InstallTrapHandler
    );

Changes in API arguments

Interrupt handlers/service installation

All below-listed APIs for installing interrupt handlers/services contain additional arguments for setting the interrupt controller priority. Two least-urgent priorities (highest number priorities) are reserved by the PXROS-HR so that the user can use N-2 priorities, where N is defined by the architecture, usually 8 or 16, depending on number of implemented bits in the NVIC register.

  • PxIntInstallHandler

  • PxIntInstallFastHandler

  • PxIntInstallFastContextHandler

  • PxIntInstallService

Code 5. PxIntInstallHandler
PxError_t PxIntInstallHandler(
    PxInt_t intno,
    PxUInt_t prio,
    PxInterrupt_t intObj,
    PxIntHandler_t inthandler,
    PxArg_t arg
    );
Code 6. PxIntInstallFastHandler
PxError_t PxIntInstallFastHandler(
    PxInt_t intno,
    PxUInt_t prio,
    PxIntHandler_t inthandler,
    PxArg_t arg
    );
Code 7. PxIntInstallFastContextHandler
PxError_t PxIntInstallFastContextHandler(
    PxInt_t intno,
    PxUInt_t prio,
    PxIntHandler_t inthandler,
    PxArg_t arg
    );
Code 8. PxIntInstallService
PxError_t PxIntInstallService(
    PxInt_t intno,
    PxUInt_t prio,
    PxUInt_t service,
    PxArg_t arg,
    PxEvents_t events
    );

PxTrapAbort

Two arguments present in the TriCore version of PXROS-HR are not present in the ARM version as they are irrelevant.

Code 9. PxTrapAbort
void PxTrapAbort (int trapno);

PxTrapInstallHandler

In PXROS-HR, this API installs the C-function handler as a trap handler for the trap class indicated by argument 'trapno'. Whenever this trap occurs, the handler is called with six arguments. In the ARM version, the arguments are:

  • the trap number.

  • a user defined argument.

  • identifier of the task that caused the trap.

  • contents of FSR (Fault Status Register).

  • contents of MMFAR (MemManage Fault Address Register) or BFAR (BusFault Address Register).

  • a pointer to the saved register frame.

Unsupported APIs

_PxInit_Start_Cores

This API is unsupported by the ARM version of PXROS-HR as it does not support multi-core features yet.

Deprecated APIs

_PxHndcall

This PXROS-HR handler call is deprecated in the ARM version. Two new APIs providing more consistency and flexibility are implemented instead, see New PxHndcall variants.