next up previous contents
Next: 4.1.9 Events for ix86 Up: 4.1 Input/Output Previous: 4.1.7 Dumping event tables

4.1.8 Traps and interrupts for plain users

On the one hand, users can interact with trap and interrupt tables through methods provided by Shuttles and Processors. Thus, Shuttle (see section [*]) and and Processor (see section [*]) behave as a facade because they provide simple entry points to handle both trap and interrupt tables. On the other hand, individual events (trap and interrupt entries) are exported to users by means of a wrapper class.

<Off event for users. >=
ENTRY class off_uEvent : public off_uHWResUnit {
public:
   void set_handler( off_prtl_id_t h, const off_Rights &r);
   off_prtl_id_t get_handler(const off_Rights &r) const;
};
Defines off_uEvent (links are to index).

There is nothing specific for user traps as of this day.

<Off Trap for users. >=
ENTRY class off_uTrap : public off_uEvent {
public:
};
Defines off_uTrap (links are to index).

On the other hand, interrupts export a few methods.

<Off Irq for users. >=
ENTRY class off_uIrq: public off_uEvent {
public:
   void raise(const off_Rights &r);
   void set_prty(off_pl_t prty, const off_Rights &r);
   off_pl_t get_prty(const off_Rights &r) const;
};
Defines off_uIrq (links are to index).

\subsection{Event \cpp{} source files}

Event table code is kept in hw/EventTbl.h and hw/EventTbl.C.

<EventTbl.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_EVENT_TBL_H
#define __OFF_EVENT_TBL_H 1

<Off event table dependencies. >

#ifdef __KERNEL__
<Off event table. >
<Off trap table. >
<Off interrupt table. >
#endif // __KERNEL__

#ifdef __KERNEL__
// Event table inline methods
//
<off_IntTbl::mask unmask and is_masked implementation. >
<off_TrapTbl::is_local implementation. >
<off_IntTbl::is_local implementation. >
<off_TrapTbl::get_allocator implementation. >
<off_IntTbl::get_allocator implementation. >
<off_IntTbl::defer implementation. >
<off_TrapTbl::operator + implementation. >
<off_IntTbl::operator + implementation. >
<off_IntTbl::get_vint0 implementation. >
<off_IntTbl::get_clk implementation. >
#endif // __KERNEL__

#endif // __OFF_EVENT_TBL_H

<EventTbl.C*>=
<Read the literate code instead warning. >

#include <hw/EventTbl.h>        // Exported interface.
<Off event table implementation dependencies. >

<Off event table static members. >

<off_TrapTbl::alloc implementation. >
<off_TrapTbl::free implementation. >
<off_IntTbl::alloc implementation. >
<off_IntTbl::free implementation. >
<off_TrapTbl::off_TrapTbl implementation. >
<off_IntTbl::off_IntTbl implementation. >
<off_TrapTbl::get_count implementation. >
<off_IntTbl::get_count implementation. >
<off_IntTbl::spl implementation. >
<off_IntTbl::nameof implementation. >
<off_TrapTbl::nameof implementation. >
<off_TrapTbl::get_url implementation. >
<off_IntTbl::get_url implementation. >

Events are kept in Event.h and hw/Event.C.

<Event.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_EVENT_H
#define __OFF_EVENT_H 1

<Off event dependencies. >

<Off interrupt priority level data type. >
<Off default priority levels. >

#ifdef __KERNEL__
<Off event handler. >
<Off event. >
<Off Trap. >
<Off Irq. >
#endif // __KERNEL__

<Off null event handler. >

#endif // __OFF_EVENT_H

<Event.C*>=
<Read the literate code instead warning. >

#include <hw/Event.h>           // Exported interface.
<Off event implementation dependencies. >

<Off trap static members. >
<Off interrupt static members. >

<off_Event::get_count implementation. >
<off_Irq::off_Irq implementation. >
<off_Event::~off_Event implementation. >
<off_Irq::~off_Irq implementation. >
<off_Event::get_handler implementation. >
<off_Irq::set_prty implementation. >
<off_Irq::get_prty implementation. >
<off_Irq::deferred implementation. >

<off_KrnEventHandler::off_KrnEventHandler implementation. >
<off_UsrEventHandler::off_UsrEventHandler implementation. >
<off_Event::off_Event implementation. >
<off_Event::set_handler implementation. >
<off_Event::raise implementation. >
<off_Trap::raise implementation. >
<off_Irq::raise implementation. >
<off_Trap::operator new/delete implementation. >
<off_Irq::operator new/delete implementation. >
<off_UsrEventHandler::operator() implementation. >
<off_KrnEventHandler::operator() implementation. >
<off_Irq::mask implementation. >
<off_Irq::unmask implementation. >
<off_Irq::is_masked implementation. >
<off_Irq::defer implementation. >
<off_Trap::copy_state implementation. >
<off_Trap::restore_state implementation. >
<off_Irq::copy_state implementation. >
<off_Irq::restore_state implementation. >
<off_Trap::get_url_holder implementation. >
<off_Irq::get_url_holder implementation. >

The event allocator is kept in EvAllocator.h and EvAllocator.C.

<EvAllocator.h*>=
<Read the literate code instead warning. >
#ifndef __OFF_EV_ALLOCATOR_H
#define __OFF_EV_ALLOCATOR_H 1

<Off event allocator dependencies. >

#ifdef __KERNEL__
<Off trap allocator. >
<Off interrupt allocator. >
#endif // __KERNEL__

#ifdef __KERNEL__
<off_TrapAllocator::operator + implementation. >
<off_IntAllocator::operator + implementation. >

#endif // __KERNEL__

#endif // __OFF_EV_ALLOCATOR_H

<EvAllocator.C*>=
<Read the literate code instead warning. >

#include <hw/EvAllocator.h>     // Exported interface

<Off trap allocator static members. >
<Off interrupt allocator static members. >



Francisco J. Ballesteros
1998-05-25