~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to extras/mini-os/include/events.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
 
2
 ****************************************************************************
 
3
 * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
 
4
 * (C) 2005 - Grzegorz Milos - Intel Reseach Cambridge
 
5
 ****************************************************************************
 
6
 *
 
7
 *        File: events.h
 
8
 *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
 
9
 *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
 
10
 *              
 
11
 *        Date: Jul 2003, changes Jun 2005
 
12
 * 
 
13
 * Environment: Xen Minimal OS
 
14
 * Description: Deals with events on the event channels
 
15
 *
 
16
 ****************************************************************************
 
17
 */
 
18
 
 
19
#ifndef _EVENTS_H_
 
20
#define _EVENTS_H_
 
21
 
 
22
#include<mini-os/traps.h>
 
23
#include<xen/event_channel.h>
 
24
 
 
25
typedef void (*evtchn_handler_t)(evtchn_port_t, struct pt_regs *, void *);
 
26
 
 
27
/* prototypes */
 
28
int do_event(evtchn_port_t port, struct pt_regs *regs);
 
29
evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
 
30
evtchn_port_t bind_pirq(uint32_t pirq, int will_share, evtchn_handler_t handler, void *data);
 
31
evtchn_port_t bind_evtchn(evtchn_port_t port, evtchn_handler_t handler,
 
32
                                                  void *data);
 
33
void unbind_evtchn(evtchn_port_t port);
 
34
void init_events(void);
 
35
int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
 
36
                                                 void *data, evtchn_port_t *port);
 
37
int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
 
38
                                                        evtchn_handler_t handler, void *data,
 
39
                                                        evtchn_port_t *local_port);
 
40
void unbind_all_ports(void);
 
41
 
 
42
static inline int notify_remote_via_evtchn(evtchn_port_t port)
 
43
{
 
44
    evtchn_send_t op;
 
45
    op.port = port;
 
46
    return HYPERVISOR_event_channel_op(EVTCHNOP_send, &op);
 
47
}
 
48
 
 
49
void fini_events(void);
 
50
 
 
51
#endif /* _EVENTS_H_ */