aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/i387.h
blob: 1f5fe50faf08c7f44e729133a82f6909970f097d (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * include/asm-i386/i387.h
 *
 * Copyright (C) 1994 Linus Torvalds
 *
 * Pentium III FXSR, SSE support
 * General FPU state handling cleanups
 *	Gareth Hughes <gareth@valinux.com>, May 2000
 */

#ifndef __ASM_I386_I387_H
#define __ASM_I386_I387_H

#include <xen/types.h>
#include <xen/percpu.h>

/* Byte offset of the stored word size within the FXSAVE area/portion. */
#define FPU_WORD_SIZE_OFFSET 511

struct ix87_state {
    struct ix87_env {
        uint16_t fcw, _res0;
        uint16_t fsw, _res1;
        uint16_t ftw, _res2;
        uint32_t fip;
        uint16_t fcs;
        uint16_t fop;
        uint32_t fdp;
        uint16_t fds, _res6;
    } env;
    struct ix87_reg {
        uint64_t mantissa;
        uint16_t exponent:15;
        uint16_t sign:1;
    } __attribute__((__packed__)) r[8];
};

void vcpu_restore_fpu_eager(struct vcpu *v);
void vcpu_restore_fpu_lazy(struct vcpu *v);
void vcpu_save_fpu(struct vcpu *v);

int vcpu_init_fpu(struct vcpu *v);
void vcpu_destroy_fpu(struct vcpu *v);
#endif /* __ASM_I386_I387_H */