kse_asm.S (103581) | kse_asm.S (103973) |
---|---|
1/* 2 * Copyright (c) 2002 Jonathan Mini <mini@freebsd.org>. 3 * Copyright (c) 2001 Daniel Eischen <deischen@freebsd.org>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/* 2 * Copyright (c) 2002 Jonathan Mini <mini@freebsd.org>. 3 * Copyright (c) 2001 Daniel Eischen <deischen@freebsd.org>. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/tools/KSE/ksetest/kse_asm.S 103581 2002-09-19 02:15:27Z mini $ | 27 * $FreeBSD: head/tools/KSE/ksetest/kse_asm.S 103973 2002-09-25 18:14:38Z archie $ |
28 */ 29 30#include <machine/asm.h> | 28 */ 29 30#include <machine/asm.h> |
31__FBSDID("$FreeBSD: head/tools/KSE/ksetest/kse_asm.S 103581 2002-09-19 02:15:27Z mini $"); | 31__FBSDID("$FreeBSD: head/tools/KSE/ksetest/kse_asm.S 103973 2002-09-25 18:14:38Z archie $"); |
32 33/* 34 * Where do we define these? 35 */ 36#define MC_SIZE 640 /* sizeof mcontext_t */ 37#define UC_MC_OFFSET 16 /* offset to mcontext from ucontext */ 38#define UC_MC_LEN_OFFSET 96 /* offset to mc_len from mcontext */ 39#define MC_LEN_OFFSET 80 /* offset to mc_len from mcontext */ 40#define MC_FP_REGS_OFFSET 96 /* offset to FP regs from mcontext */ 41#define MC_FP_CW_OFFSET 96 /* offset to FP control word */ 42#define MC_OWNEDFP_OFFSET 88 /* offset to mc_ownedfp from mcontext */ 43#define KM_STACK_SP_OFFSET 32 /* offset to km_stack.ss_sp */ 44#define KM_STACK_SIZE_OFFSET 36 /* offset to km_stack.ss_sp */ 45#define KM_FUNC_OFFSET 28 /* offset to km_func */ 46 47/* | 32 33/* 34 * Where do we define these? 35 */ 36#define MC_SIZE 640 /* sizeof mcontext_t */ 37#define UC_MC_OFFSET 16 /* offset to mcontext from ucontext */ 38#define UC_MC_LEN_OFFSET 96 /* offset to mc_len from mcontext */ 39#define MC_LEN_OFFSET 80 /* offset to mc_len from mcontext */ 40#define MC_FP_REGS_OFFSET 96 /* offset to FP regs from mcontext */ 41#define MC_FP_CW_OFFSET 96 /* offset to FP control word */ 42#define MC_OWNEDFP_OFFSET 88 /* offset to mc_ownedfp from mcontext */ 43#define KM_STACK_SP_OFFSET 32 /* offset to km_stack.ss_sp */ 44#define KM_STACK_SIZE_OFFSET 36 /* offset to km_stack.ss_sp */ 45#define KM_FUNC_OFFSET 28 /* offset to km_func */ 46 47/* |
48 * int uts_to_thread(thread_mailbox *tdp, thread_mailbox **curthreadp); | 48 * int uts_to_thread(struct kse_thr_mailbox *tdp, 49 * struct kse_thr_mailbox **curthreadp); |
49 * 50 * Does not return on success, returns -1 otherwise. 51 */ 52ENTRY(uts_to_thread) | 50 * 51 * Does not return on success, returns -1 otherwise. 52 */ 53ENTRY(uts_to_thread) |
53 movl 4(%esp), %edx /* get address of thread_mailbox */ | 54 movl 4(%esp), %edx /* get address of kse_thr_mailbox */ |
54 /* .. ucontext_t is at offset 0 */ 55 cmpl $0, %edx /* check for null pointer */ 56 jne 1f 57 movl $-1, %eax 58 jmp 5f 591: cmpl $MC_SIZE, UC_MC_LEN_OFFSET(%edx) /* is context valid? */ 60 je 2f 61 movl $-1, %eax /* bzzzt, invalid context */ --- 27 unchanged lines hidden (view full) --- 89 movl 44(%edx), %ecx 90 pushl 68(%edx) /* flags on stack */ 91 pushl 40(%edx) /* %edx on stack */ 92 popl %edx /* %edx off stack */ 93 popf /* flags off stack */ 945: ret /* %eip off stack */ 95 96/* | 55 /* .. ucontext_t is at offset 0 */ 56 cmpl $0, %edx /* check for null pointer */ 57 jne 1f 58 movl $-1, %eax 59 jmp 5f 601: cmpl $MC_SIZE, UC_MC_LEN_OFFSET(%edx) /* is context valid? */ 61 je 2f 62 movl $-1, %eax /* bzzzt, invalid context */ --- 27 unchanged lines hidden (view full) --- 90 movl 44(%edx), %ecx 91 pushl 68(%edx) /* flags on stack */ 92 pushl 40(%edx) /* %edx on stack */ 93 popl %edx /* %edx off stack */ 94 popf /* flags off stack */ 955: ret /* %eip off stack */ 96 97/* |
97 * int thread_to_uts(thread_mailbox *tm, kse_mailbox *km); | 98 * int thread_to_uts(struct kse_thr_mailbox *tm, struct kse_mailbox *km); |
98 * 99 * Does not return on success, returns -1 otherwise. 100 */ 101ENTRY(thread_to_uts) 102 movl 4(%esp), %eax /* get address of context */ 103 cmpl $0, %eax /* check for null pointer */ 104 jne 1f 105 movl $-1, %eax --- 44 unchanged lines hidden --- | 99 * 100 * Does not return on success, returns -1 otherwise. 101 */ 102ENTRY(thread_to_uts) 103 movl 4(%esp), %eax /* get address of context */ 104 cmpl $0, %eax /* check for null pointer */ 105 jne 1f 106 movl $-1, %eax --- 44 unchanged lines hidden --- |