Previous

Next

Bottom

Contents

Glossary

Index

 

Persistor CF1 User's Manual

Interrupt and Exception Vector Wrapper Functions

July 1998

Revision 1.01

 Persistor Instruments Inc.
© 1998 All rights reserved.

Quick Reference Table

IEV_C_FUNCT

IEVInit

IEV_C_PROTO

IEVInsertAsmFunct

IEVCoreDump

IEVInsertCFunct

IEVFillVectorTable

Background

The interrupt and exception vector functions provide high level access to some very low level system facilities.

IEV_C_FUNCT -- Define C Interrupt Handler Function

This is a macro function provided in cf1bios.h for declaring a function that you wish to install as an interrupt or exception handling routine. Its syntactic usage is best documented by an example which appears in the table below. You must use this if you wish to install a function written in C as an exception or interrupt service routine.

Example:

IEV_C_PROTO(level7InterruptISR);
IEV_C_FUNCT(level7InterruptISR)
{
    // your ISR code written in C...
}

Definition:

#include <cf1bios.h>

Notes:

Timing:

Timing-TBD

IEV_C_PROTO -- Declare C Interrupt Handler Function Prototype

This is a macro function provided in cf1bios.h for prototyping a function that you wish to install as an interrupt or exception handling routine. Its syntactic usage is best documented by an example which appears in the table below. You must use this if you wish to install a function written in C as an exception or interrupt service routine.

Example:

IEV_C_PROTO(level7InterruptISR);
IEV_C_FUNCT(level7InterruptISR)
{
    // your ISR code written in C...
}

Definition:

#include <cf1bios.h>

Notes:

Timing:

Timing-TBD

IEVFillVectorTable -- Fill interrupt/exception table range with whatever

This function is called at startup by IEVInit(). It is highly unlikely that you would ever use this function. This function is intended as a method to fill the table with a default action. For installing individual handlers please see the functions IEVInsertCFunct or IEVInsertAsmFunct.

Prototype:

void IEVFillVectorTable(vfptr fp, short firstv, short lastv);

Definition:

#include <cf1bios.h>

Inputs:

fp is the pointer to the handler (should not be a C function. see notes)
firstv is the starting vector number of the range of slots in the vector table you wish to replace
lastv is the last slot number in the vector table that you wish to replace.

Notes:

Due to differences in calling conventions, there are certain steps you need to take to use a C function as an interrupt or exception service routine. The CF1 provides a method of doing this via the IEV_C_PROTO and IEV_C_FUNCT macros in combination with IEVInsertCFunct. Please see those function references for a more detailed description.

Timing:

Timing-TBD

IEVCoreDump -- Dump the decoded interrupt/exception captured information

This function is included for completeness only. It is not meant to be used by your applications and is beyond the scope of this reference manual. In the future, if necessary, a detailed application note will be released that describes the use of this function.

Prototype:

void IEVCoreDump(long stmem:__d0);

Definition:

#include <cf1bios.h>

Inputs:

stmem:_d0

Notes:

Timing:

Timing-TBD

IEVInit -- Fill interrupt/exception table with default catch mechanism

This function would not be called by a user's application unless the user was resequencing the CF1 startup sequence. This function is called at startup by the BIOS initialization routines and performs general setup for the interrupt and exception vector handing system. This function also fills in the entire vector table with the appropriate default handlers. The default handler is a bit of code that, on an exception, will display information about the registers and other immediate information and then gives you ten seconds to request a full context dump before resetting the machine.

Prototype:

void IEVInit(void);

Definition:

#include <cf1bios.h>

Notes:

Timing:

Timing-TBD

IEVInsertAsmFunct -- Install an assembler function into the VBR

This function allows you to install an interrupt or exception handler written in 68338 assembly language into the vector table. This varies from the IEVInsertCFunct function in that it assumes that the calling and return conventions for interrupt and exception handling have already been used when the function was written. It is not necessary to use the C handler definition macros (IEV_C_PROTO and IEV_C_FUNCT) when creating an assembly function as an interrupt or exception handler. It is assumed that you know how to write these handlers when using this function. You would also use this function to reinstall a previously de-installed interrupt or exception handler whose pointer was returned by a previous call to IEVInsertCFunct or IEVInsertAsmFunct call.

Prototype:

vfptr IEVInsertAsmFunct(vfptr afp, short vector);

Definition:

#include <cf1bios.h>

Inputs:

afp is the pointer to the assembly routine you wish to install.
vector is the vector table "slot number" you wish to install this ISR into. (see the CPU32 documentation for more info on the vector table)

Returns:

Returns a pointer to the function that was previously installed in the target slot so that you can restore it later if you so desire.

Notes:

See the Motorola CPU32 documentation for more info.

Timing:

Timing-TBD

IEVInsertCFunct -- Install a C function into the vector table

This function allows you to install an interrupt or exception handler written in C into the vector table. You must first prototype and declare the function using the IEV_C_PROTO and IEV_C_FUNCT macros. Normally a C compiler will return from a function using a 68000 RTS instruction, but it an interrupt or exception handler must return with an RTE instruction to avoid causing havoc with the registers and the stack. This is provided for with the aforementioned macros provided.

Prototype:

vfptr IEVInsertCFunct(IEVCWrapper *cfp, short vector);

Definition:

#include <cf1bios.h>

Inputs:

cfp is the name of the function you wish to install. It mast have been prototyped an declared using the IEV_C_PROTO and IEV_C_FUNCT macros.
vector is the vector table "slot number" you wish to install this ISR into. (see the CPU32 documentation for more info on the vector table)

Returns:

Returns a pointer to the function that was previously installed in the target slot so that you can restore it later if you so desire.

Notes:

See the Motorola CPU32 documentation for more info.

Timing:

Timing-TBD

Previous

Next

Top

Contents

Glossary

Index

Tel: 508-759-6434

Fax: 508-759-6436

Copyright (C) 1998 Persistor Instruments Inc. - All Rights Reserved