dev.h File Reference

This file contains all defintions related to the device concept of mkernel. More...

#include "typedefs.h"

Go to the source code of this file.

Classes

struct  t_dev
 Device descriptor. More...

Defines

#define MAX_INTERRUPTS   4
 The device handler handles upto MAX_INTERRUPTS devices.
#define NULL_HANDLER   (t_handler)0
 This value should be used to indicate that a handler is not available,e.g the interrupt handler.
#define DeclareDevice(x, init)   __code t_dev x = { &init, NULL_HANDLER }
#define DeclareInterrupt(x, init, intr)   __code t_dev x = { &init, &intr }

Typedefs

typedef byte(* t_handler )(void)
 A Handler function.


Detailed Description

This file contains all defintions related to the device concept of mkernel.

A device descriptor consists of two handler functions. One init function which has the purpose of initializing hardware after startup and an interrupt handler which is called on each interrupt. If an interrupt handler is called, the interrupt handler checks the interrupt flags whether the interrupt is to be services by this handler. If not the handler returns false to indicate that the next interrupt handler should be called. Otherwise the interrupt handler services the interrupt and return true and no futher interrupt handlers will be called.

The first interrupt handler in the device list _Dev which has the value NULL_HANDLER will terminate the interrupt scan. There for devices which are serving interrupts have to be put in front of the devices which dont server any interrupt.

Definition in file dev.h.


Generated on Mon Sep 29 19:56:48 2008 for mKernel by  doxygen 1.4.6