File: interrupt.c

package info (click to toggle)
kvmtool 0.20161128-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,748 kB
  • ctags: 6,310
  • sloc: ansic: 25,215; makefile: 495; asm: 212; sh: 122
file content (28 lines) | stat: -rw-r--r-- 668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "kvm/interrupt.h"

#include "kvm/util.h"

#include <string.h>

void interrupt_table__copy(struct interrupt_table *itable, void *dst, unsigned int size)
{
	if (size < sizeof(itable->entries))
		die("An attempt to overwrite host memory");

	memcpy(dst, itable->entries, sizeof(itable->entries));
}

void interrupt_table__setup(struct interrupt_table *itable, struct real_intr_desc *entry)
{
	unsigned int i;

	for (i = 0; i < REAL_INTR_VECTORS; i++)
		itable->entries[i] = *entry;
}

void interrupt_table__set(struct interrupt_table *itable,
				struct real_intr_desc *entry, unsigned int num)
{
	if (num < REAL_INTR_VECTORS)
		itable->entries[num] = *entry;
}