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"
12 #include "frame_user.h"
14 int sc_size(void *data)
16 struct arch_frame_data *arch = data;
18 return(sizeof(struct sigcontext) + arch->fpstate_size);
21 void sc_to_sc(void *to_ptr, void *from_ptr)
23 struct sigcontext *to = to_ptr, *from = from_ptr;
24 int size = sizeof(*to) + signal_frame_sc.common.arch.fpstate_size;
26 memcpy(to, from, size);
27 if(from->fpstate != NULL) to->fpstate = (struct _fpstate *) (to + 1);
30 unsigned long *sc_sigmask(void *sc_ptr)
32 struct sigcontext *sc = sc_ptr;
37 int sc_get_fpregs(unsigned long buf, void *sc_ptr)
39 struct sigcontext *sc = sc_ptr;
40 struct _fpstate *from = sc->fpstate, *to = (struct _fpstate *) buf;
44 err |= clear_user_proc(&to->cw, sizeof(to->cw));
45 err |= clear_user_proc(&to->sw, sizeof(to->sw));
46 err |= clear_user_proc(&to->tag, sizeof(to->tag));
47 err |= clear_user_proc(&to->ipoff, sizeof(to->ipoff));
48 err |= clear_user_proc(&to->cssel, sizeof(to->cssel));
49 err |= clear_user_proc(&to->dataoff, sizeof(to->dataoff));
50 err |= clear_user_proc(&to->datasel, sizeof(to->datasel));
51 err |= clear_user_proc(&to->_st, sizeof(to->_st));
54 err |= copy_to_user_proc(&to->cw, &from->cw, sizeof(to->cw));
55 err |= copy_to_user_proc(&to->sw, &from->sw, sizeof(to->sw));
56 err |= copy_to_user_proc(&to->tag, &from->tag,
58 err |= copy_to_user_proc(&to->ipoff, &from->ipoff,
60 err |= copy_to_user_proc(&to->cssel,& from->cssel,
62 err |= copy_to_user_proc(&to->dataoff, &from->dataoff,
64 err |= copy_to_user_proc(&to->datasel, &from->datasel,
66 err |= copy_to_user_proc(to->_st, from->_st, sizeof(to->_st));
72 * Overrides for Emacs so that we follow Linus's tabbing style.
73 * Emacs will notice this stuff at the end of the file and automatically
74 * adjust the settings for this buffer only. This must remain at the end
76 * ---------------------------------------------------------------------------
78 * c-file-style: "linux"