build/ccw_gen: stat the file in C instead of shelling out
[hvf.git] / cp / guest / exception.c
blobc07df5166ea9784a78d240f2185d922a5de777eb
1 /*
2 * (C) Copyright 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
5 * details.
6 */
8 #include <sched.h>
9 #include <vcpu.h>
10 #include <slab.h>
12 void queue_prog_exception(struct virt_sys *sys, enum PROG_EXCEPTION type, u64 param)
14 FIXME("supposed to inject a %d program exception", type);
15 con_printf(sys->con, "FIXME: supposed to inject a %d program exception\n", type);
16 sys->cpu->state = GUEST_STOPPED;
19 void queue_io_interrupt(struct virt_sys *sys, u32 ssid, u32 param, u32 a, u32 isc)
21 struct vio_int *ioint;
23 BUG_ON(isc >= 8);
24 BUG_ON((a != 0) && (a != 1));
26 ioint = malloc(sizeof(struct vio_int), ZONE_NORMAL);
27 BUG_ON(!ioint);
29 ioint->ssid = ssid;
30 ioint->param = param;
31 ioint->intid = (a << 31) | (isc << 27);
33 mutex_lock(&sys->cpu->int_lock);
34 list_add_tail(&ioint->list, &sys->cpu->int_io[isc]);
36 con_printf(sys->con, "queued I/O int %d %08x.%08x.%08x\n", isc,
37 ioint->ssid, ioint->param, ioint->intid);
38 mutex_unlock(&sys->cpu->int_lock);