Deleted Added
full compact
context.S (120108) context.S (121163)
1/*
2 * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <machine/asm.h>
1/*
2 * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <machine/asm.h>
28__FBSDID("$FreeBSD: head/lib/libkse/arch/amd64/amd64/context.S 120108 2003-09-16 00:00:53Z deischen $");
28__FBSDID("$FreeBSD: head/lib/libkse/arch/amd64/amd64/context.S 121163 2003-10-17 16:30:09Z peter $");
29
30/*
31 * The following notes ("cheat sheet") was provided by Peter Wemm.
32 *
33 * scratch:
34 * rax (1st return)
35 * rcx (4th arg)
36 * rdx (3rd arg, 2nd return)

--- 37 unchanged lines hidden (view full) ---

74 * means a sparse 512 byte FPU context.
75 */
76
77
78/*
79 * Where do we define these?
80 */
81#define MC_SIZE 800 /* sizeof mcontext_t */
29
30/*
31 * The following notes ("cheat sheet") was provided by Peter Wemm.
32 *
33 * scratch:
34 * rax (1st return)
35 * rcx (4th arg)
36 * rdx (3rd arg, 2nd return)

--- 37 unchanged lines hidden (view full) ---

74 * means a sparse 512 byte FPU context.
75 */
76
77
78/*
79 * Where do we define these?
80 */
81#define MC_SIZE 800 /* sizeof mcontext_t */
82#define MC_LEN_OFFSET (24*8) /* offset to mc_len from mcontext */
83#define MC_FPFMT_OFFSET (25*8) /* offset to mc_fpformat from mcontext */
84#define MC_FPFMT_NODEV 0x10000
85#define MC_OWNEDFP_OFFSET (26*8) /* offset to mc_ownedfp from mcontext */
82#define MC_LEN_OFFSET (25*8) /* offset to mc_len from mcontext */
83#define MC_FPFMT_OFFSET (26*8) /* offset to mc_fpformat from mcontext */
84#define MC_FPFMT_NODEV 0x10000
85#define MC_OWNEDFP_OFFSET (27*8) /* offset to mc_ownedfp from mcontext */
86#define MC_OWNEDFP_NONE 0x20000
87#define MC_OWNEDFP_FPU 0x20001
88#define MC_OWNEDFP_PCB 0x20002
89#define MC_FPREGS_OFFSET (28*8) /* offset to FP registers */
90#define MC_FP_CW_OFFSET (28*8) /* offset to FP control word */
91
92#define MC_RDI (1 * 8)
93#define MC_RSI (2 * 8)

--- 5 unchanged lines hidden (view full) ---

99#define MC_RBX (8 * 8)
100#define MC_RBP (9 * 8)
101#define MC_R10 (10 * 8)
102#define MC_R11 (11 * 8)
103#define MC_R12 (12 * 8)
104#define MC_R13 (13 * 8)
105#define MC_R14 (14 * 8)
106#define MC_R15 (15 * 8)
86#define MC_OWNEDFP_NONE 0x20000
87#define MC_OWNEDFP_FPU 0x20001
88#define MC_OWNEDFP_PCB 0x20002
89#define MC_FPREGS_OFFSET (28*8) /* offset to FP registers */
90#define MC_FP_CW_OFFSET (28*8) /* offset to FP control word */
91
92#define MC_RDI (1 * 8)
93#define MC_RSI (2 * 8)

--- 5 unchanged lines hidden (view full) ---

99#define MC_RBX (8 * 8)
100#define MC_RBP (9 * 8)
101#define MC_R10 (10 * 8)
102#define MC_R11 (11 * 8)
103#define MC_R12 (12 * 8)
104#define MC_R13 (13 * 8)
105#define MC_R14 (14 * 8)
106#define MC_R15 (15 * 8)
107#define MC_RIP (19 * 8)
108#define MC_RFLAGS (21 * 8)
109#define MC_RSP (22 * 8)
107#define MC_FLAGS (18 * 8)
108#define MC_RIP (20 * 8)
109#define MC_RFLAGS (22 * 8)
110#define MC_RSP (23 * 8)
110
111/*
112 * _amd64_ctx_save(mcontext_t *mcp)
113 *
114 * No values are saved to mc_trapno, mc_addr, mc_err, mc_cs, or mc_ss.
115 * For the FPU state, only the floating point control word is stored.
116 */
117ENTRY(_amd64_save_context)

--- 92 unchanged lines hidden ---
111
112/*
113 * _amd64_ctx_save(mcontext_t *mcp)
114 *
115 * No values are saved to mc_trapno, mc_addr, mc_err, mc_cs, or mc_ss.
116 * For the FPU state, only the floating point control word is stored.
117 */
118ENTRY(_amd64_save_context)

--- 92 unchanged lines hidden ---