ia64/xen-unstable

view extras/mini-os/h/events.h @ 4072:ee7313088070

bitkeeper revision 1.1159.258.38 (4230628bX3yukmWYtNDh925BckMoHQ)

Merge ssh://xenbk@gandalf.hpl.hp.com//var/bk/xen-2.0-testing.bk
into tetris.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
author iap10@tetris.cl.cam.ac.uk
date Thu Mar 10 15:06:51 2005 +0000 (2005-03-10)
parents 3f929065a1d1
children 0a4b76b6b5a0
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
2 ****************************************************************************
3 * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
4 ****************************************************************************
5 *
6 * File: events.h
7 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
8 * Changes:
9 *
10 * Date: Jul 2003
11 *
12 * Environment: Xen Minimal OS
13 * Description: deal with events
14 *
15 ****************************************************************************
16 * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
17 ****************************************************************************
18 */
20 #ifndef _EVENTS_H_
21 #define _EVENTS_H_
23 /* _EVENT_* are defined in xen-public/xen.h */
24 #define EV_BLKDEV _EVENT_BLKDEV
25 #define EV_TIMER _EVENT_TIMER
26 #define EV_DIE _EVENT_DIE
27 #define EV_DEBUG _EVENT_DEBUG
28 #define EV_NET _EVENT_NET
29 #define EV_PS2 _EVENT_PS2
31 #define NR_EVS (sizeof(HYPERVISOR_shared_info->events) * 8)
33 /* ev handler status */
34 #define EVS_INPROGRESS 1 /* Event handler active - do not enter! */
35 #define EVS_DISABLED 2 /* Event disabled - do not enter! */
36 #define EVS_PENDING 4 /* Event pending - replay on enable */
37 #define EVS_REPLAY 8 /* Event has been replayed but not acked yet */
39 /* this represents a event handler. Chaining or sharing is not allowed */
40 typedef struct _ev_action_t {
41 void (*handler)(int, struct pt_regs *);
42 unsigned int status; /* IRQ status */
43 u32 count;
44 } ev_action_t;
46 /* prototypes */
47 unsigned int do_event(int ev, struct pt_regs *regs);
48 unsigned int add_ev_action( int ev, void (*handler)(int, struct pt_regs *) );
49 unsigned int enable_ev_action( int ev );
50 unsigned int disable_ev_action( int ev );
51 void init_events(void);
53 #endif /* _EVENTS_H_ */