OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-i386/] [i387.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * include/asm-i386/i387.h
3
 *
4
 * Copyright (C) 1994 Linus Torvalds
5
 *
6
 * Pentium III FXSR, SSE support
7
 * General FPU state handling cleanups
8
 *      Gareth Hughes <gareth@valinux.com>, May 2000
9
 */
10
 
11
#ifndef __ASM_I386_I387_H
12
#define __ASM_I386_I387_H
13
 
14
#include <linux/sched.h>
15
#include <asm/processor.h>
16
#include <asm/sigcontext.h>
17
#include <asm/user.h>
18
 
19
extern void init_fpu(void);
20
/*
21
 * FPU lazy state save handling...
22
 */
23
extern void save_init_fpu( struct task_struct *tsk );
24
extern void restore_fpu( struct task_struct *tsk );
25
 
26
extern void kernel_fpu_begin(void);
27
#define kernel_fpu_end() stts()
28
 
29
 
30
#define unlazy_fpu( tsk ) do { \
31
        if ( tsk->flags & PF_USEDFPU ) \
32
                save_init_fpu( tsk ); \
33
} while (0)
34
 
35
#define clear_fpu( tsk ) do { \
36
        if ( tsk->flags & PF_USEDFPU ) { \
37
                asm volatile("fwait"); \
38
                tsk->flags &= ~PF_USEDFPU; \
39
                stts(); \
40
        } \
41
} while (0)
42
 
43
/*
44
 * FPU state interaction...
45
 */
46
extern unsigned short get_fpu_cwd( struct task_struct *tsk );
47
extern unsigned short get_fpu_swd( struct task_struct *tsk );
48
extern unsigned short get_fpu_twd( struct task_struct *tsk );
49
extern unsigned short get_fpu_mxcsr( struct task_struct *tsk );
50
 
51
extern void set_fpu_cwd( struct task_struct *tsk, unsigned short cwd );
52
extern void set_fpu_swd( struct task_struct *tsk, unsigned short swd );
53
extern void set_fpu_twd( struct task_struct *tsk, unsigned short twd );
54
extern void set_fpu_mxcsr( struct task_struct *tsk, unsigned short mxcsr );
55
 
56
#define load_mxcsr( val ) do { \
57
        unsigned long __mxcsr = ((unsigned long)(val) & 0xffbf); \
58
        asm volatile( "ldmxcsr %0" : : "m" (__mxcsr) ); \
59
} while (0)
60
 
61
/*
62
 * Signal frame handlers...
63
 */
64
extern int save_i387( struct _fpstate *buf );
65
extern int restore_i387( struct _fpstate *buf );
66
 
67
/*
68
 * ptrace request handers...
69
 */
70
extern int get_fpregs( struct user_i387_struct *buf,
71
                       struct task_struct *tsk );
72
extern int set_fpregs( struct task_struct *tsk,
73
                       struct user_i387_struct *buf );
74
 
75
extern int get_fpxregs( struct user_fxsr_struct *buf,
76
                        struct task_struct *tsk );
77
extern int set_fpxregs( struct task_struct *tsk,
78
                        struct user_fxsr_struct *buf );
79
extern void load_empty_fpu(struct task_struct *);
80
 
81
/*
82
 * FPU state for core dumps...
83
 */
84
extern int dump_fpu( struct pt_regs *regs,
85
                     struct user_i387_struct *fpu );
86
extern int dump_extended_fpu( struct pt_regs *regs,
87
                              struct user_fxsr_struct *fpu );
88
 
89
#endif /* __ASM_I386_I387_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.