Unit 'exec' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#os4units]

AllocTrap

Allocate a processor trap vector

Declaration

Source position: exec.pas line 1875

function AllocTrap(

  TrapNum: LongWord

):LongInt;

Arguments

TrapNum

  

the desired trap number [0..15] or -1 for no preference.

Function result

The trap number allocated [0..15]. If no traps are available, this function returns -1.

Description

Allocate a trap number from the current task's pool. These trap numbers are those associated with the 68000 TRAP type instructions. Either a particular number, or the next free number may be allocated.

If the trap is already in use (or no free traps are available) a -1 is returned.

This function only affects the currently running task.

Traps are sent to the trap handler pointed at by tc_TrapCode. Unless changed by user code, this points to a standard trap handler.

tc_TrapData is not used.

WARNING

Traps may not be allocated or freed from exception handling code. You are not allowed to write to the exception table yourself.

See also

FreeTrap

  

Free a processor trap


Documentation generated on: 2021-07-30