2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
8 #include <asm/ptrace.h>
9 #include <asm/sigcontext.h>
10 #include "sysdep/ptrace.h"
11 #include "kern_util.h"
13 void sc_to_sc(void *to_ptr
, void *from_ptr
)
15 struct sigcontext
*to
= to_ptr
, *from
= from_ptr
;
17 memcpy(to
, from
, sizeof(*to
) + sizeof(struct _fpstate
));
18 if(from
->fpstate
!= NULL
)
19 to
->fpstate
= (struct _fpstate
*) (to
+ 1);
22 unsigned long *sc_sigmask(void *sc_ptr
)
24 struct sigcontext
*sc
= sc_ptr
;
28 int sc_get_fpregs(unsigned long buf
, void *sc_ptr
)
30 struct sigcontext
*sc
= sc_ptr
;
31 struct _fpstate
*from
= sc
->fpstate
, *to
= (struct _fpstate
*) buf
;
35 err
|= clear_user_proc(&to
->cw
, sizeof(to
->cw
));
36 err
|= clear_user_proc(&to
->sw
, sizeof(to
->sw
));
37 err
|= clear_user_proc(&to
->tag
, sizeof(to
->tag
));
38 err
|= clear_user_proc(&to
->ipoff
, sizeof(to
->ipoff
));
39 err
|= clear_user_proc(&to
->cssel
, sizeof(to
->cssel
));
40 err
|= clear_user_proc(&to
->dataoff
, sizeof(to
->dataoff
));
41 err
|= clear_user_proc(&to
->datasel
, sizeof(to
->datasel
));
42 err
|= clear_user_proc(&to
->_st
, sizeof(to
->_st
));
45 err
|= copy_to_user_proc(&to
->cw
, &from
->cw
, sizeof(to
->cw
));
46 err
|= copy_to_user_proc(&to
->sw
, &from
->sw
, sizeof(to
->sw
));
47 err
|= copy_to_user_proc(&to
->tag
, &from
->tag
,
49 err
|= copy_to_user_proc(&to
->ipoff
, &from
->ipoff
,
51 err
|= copy_to_user_proc(&to
->cssel
,& from
->cssel
,
53 err
|= copy_to_user_proc(&to
->dataoff
, &from
->dataoff
,
55 err
|= copy_to_user_proc(&to
->datasel
, &from
->datasel
,
57 err
|= copy_to_user_proc(to
->_st
, from
->_st
, sizeof(to
->_st
));
63 * Overrides for Emacs so that we follow Linus's tabbing style.
64 * Emacs will notice this stuff at the end of the file and automatically
65 * adjust the settings for this buffer only. This must remain at the end
67 * ---------------------------------------------------------------------------
69 * c-file-style: "linux"