Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM processor interruption
SVM processors

This module contains API functions to handle SVM processor interruption. More...

## Functions
SVM_FUNCTION void | svm_processor_interruptionhandler_set_local (const void *svm, const SVM_Kernel kernel, const SVM_Value_Interruption interruption, const SVM_Address address, const SVM_Object_Level level)
| This function sets a local interruption handler on a processor.
SVM_FUNCTION void | svm_processor_interruptionhandler_set_global (const void *svm, const SVM_Kernel kernel, const SVM_Value_Interruption interruption, const SVM_Value_Symbol symbol, const SVM_Object_Level level)
| This function sets a global interruption handler on a processor.
SVM_FUNCTION void | svm_processor_interruptionhandler_reset (const void *svm, const SVM_Kernel kernel, const SVM_Value_Interruption interruption, const SVM_Object_Level level)
| This function removes an interruption handler from a processor.
SVM_FUNCTION SVM_Boolean | svm_processor_interruptionhandler_has (const void *svm, const SVM_Kernel kernel, const SVM_Value_Interruption interruption, const SVM_Object_Level level)
| This function checks whether an interruption handler exists in a processor.
SVM_FUNCTION SVM_Value_Symbol | svm_processor_interruptionhandler_get (const void *svm, const SVM_Kernel kernel, const SVM_Value_Interruption interruption, const SVM_Object_Level level)
| This function extracts an interruption handler from a processor.
SVM_FUNCTION void | svm_processor_add_interruption (const void *svm, const SVM_Kernel kernel, const SVM_Value_Interruption interruption)
| This function interrupts a processor.
SVM_FUNCTION void | svm_processor_clear_interruption (const void *svm, const SVM_Kernel kernel)
| This function clears waiting interruptions of a processor.
SVM_FUNCTION SVM_Value_Interruption * | svm_processor_list_interruption (const void *svm, const SVM_Kernel kernel)
| This function retrieves waiting interruptions of a processor.
SVM_FUNCTION void | svm_processor_hold_interruption (const void *svm, const SVM_Kernel kernel)
| This function disables waiting interruptions handling of a processor.
SVM_FUNCTION void | svm_processor_release_interruption (const void *svm, const SVM_Kernel kernel)
| This function enables waiting interruptions handling of a processor.
SVM_FUNCTION SVM_Boolean | svm_processor_is_hardwareinterrupted (const void *svm, const SVM_Kernel kernel)
| This function detects whether an hardware interruption has been received by a processor.
SVM_FUNCTION SVM_Value_Interruption | svm_processor_get_currentinterruption (const void *svm, const SVM_Kernel kernel)
| This function extracts the current interruption of a processor.
SVM_FUNCTION void | svm_processor_set_currentinterruption (const void *svm, const SVM_Kernel kernel, const SVM_Value_Interruption interruption)
| This function modifies the current interruption of a processor.

## Detailed Description

This module contains API functions to handle SVM processor interruption.

## Function Documentation

## ◆ svm_processor_add_interruption()

SVM_FUNCTION void svm_processor_add_interruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Interruption | interruption
| ) |  |

This function interrupts a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | interruption | The interruption to append in the interruption list of the processor.

Note
  When applied on the current processor, the execution of the current instruction is not stopped. The interruption will occur after the instruction execution completion. To interrupt also the current instruction execution, please refer to the svm_processor_current_raise_error API function.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_processor_current_raise_error
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_clear_interruption()

SVM_FUNCTION void svm_processor_clear_interruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function clears waiting interruptions of a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.

This function removes all waiting interruptions of a processor.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_get_currentinterruption()

SVM_FUNCTION SVM_Value_Interruption svm_processor_get_currentinterruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function extracts the current interruption of a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.

Returns
  The current interruption value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_hold_interruption()

SVM_FUNCTION void svm_processor_hold_interruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function disables waiting interruptions handling of a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.

This function disables waiting interruption handling by the processor. Waiting interruptions will be put on hold by the processor and will accumulate all raised interruptions.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_processor_release_interruption
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_interruptionhandler_get()

SVM_FUNCTION SVM_Value_Symbol svm_processor_interruptionhandler_get | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Interruption | interruption,
|  | const SVM_Object_Level | level
| ) |  |

This function extracts an interruption handler from a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | interruption | The interruption for which the handler has to be extracted.
  [in] | level | The level of interruption.

Note
  The interruption message and kind are ignored.
  The level can be LOCAL or GLOBAL. Cascaded interruptions are considered local by this API function.

Returns
  The symbol associated to the interruption handler.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.
  PROCESSOR | interruption when the interruption handler does not exist.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_interruptionhandler_has()

SVM_FUNCTION SVM_Boolean svm_processor_interruptionhandler_has | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Interruption | interruption,
|  | const SVM_Object_Level | level
| ) |  |

This function checks whether an interruption handler exists in a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | interruption | The interruption for which the handler has to be extracted.
  [in] | level | The level of interruption.

Note
  The interruption message and kind are ignored.
  The level can be LOCAL or GLOBAL. Cascaded interruptions are considered local by this API function.

Returns
  TRUE if an handler exists in the current state of the procerror, FALSE otherwise.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_interruptionhandler_reset()

SVM_FUNCTION void svm_processor_interruptionhandler_reset | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Interruption | interruption,
|  | const SVM_Object_Level | level
| ) |  |

This function removes an interruption handler from a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | interruption | The interruption for which the handler has to be reset.
  [in] | level | The level of interruption.

Note
  The interruption message and kind are ignored.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_interruptionhandler_set_global()

SVM_FUNCTION void svm_processor_interruptionhandler_set_global | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Interruption | interruption,
|  | const SVM_Value_Symbol | symbol,
|  | const SVM_Object_Level | level
| ) |  |

This function sets a global interruption handler on a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | interruption | The interruption for which the handler has to be set.
  [in] | symbol | The global address of the handler.
  [in] | level | The level of interruption.

Note
  The interruption message and kind are ignored.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_interruptionhandler_set_local()

SVM_FUNCTION void svm_processor_interruptionhandler_set_local | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Interruption | interruption,
|  | const SVM_Address | address,
|  | const SVM_Object_Level | level
| ) |  |

This function sets a local interruption handler on a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | interruption | The interruption for which the handler has to be set.
  [in] | address | The local address of the handler.
  [in] | level | The level of interruption.

Note
  The interruption message and kind are ignored.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_is_hardwareinterrupted()

SVM_FUNCTION SVM_Boolean svm_processor_is_hardwareinterrupted | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function detects whether an hardware interruption has been received by a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.

This API function can be useful to interrupt blocking instructions on a signal.

Returns
  TRUE if the processor received at least one hardware interruption, FALSE otherwise.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_list_interruption()

SVM_FUNCTION SVM_Value_Interruption * svm_processor_list_interruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function retrieves waiting interruptions of a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.

Returns
  A pointer to a C array of SVM_Value_Interruption, terminated by a C/C++ null pointer.

Note
  The returned array is a valid SVM variable: its scope can be changed if needed, and the pointer shall not be freed explicitely.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_release_interruption()

SVM_FUNCTION void svm_processor_release_interruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel
| ) |  |

This function enables waiting interruptions handling of a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.

This function enables waiting interruption handling by the processor. Waiting interruptions will be taken into account as soon as possible by the processor.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_processor_hold_interruption
  svm_process_ownership_lock
  svm_kernel_get_current

## ◆ svm_processor_set_currentinterruption()

SVM_FUNCTION void svm_processor_set_currentinterruption | ( | const void * | svm,
|  | const SVM_Kernel | kernel,
|  | const SVM_Value_Interruption | interruption
| ) |  |

This function modifies the current interruption of a processor.

Parameters

  [in] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | kernel | The kernel in which the targeted processor is.
  [in] | interruption | The new value of the current interruption.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the kernel is not owned by our process or is not in a process locked by ours.

See also
  svm_process_ownership_lock
  svm_kernel_get_current