Deleted Added
full compact
freebsd32_misc.c (169901) freebsd32_misc.c (170870)
1/*-
2 * Copyright (c) 2002 Doug Rabson
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 <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002 Doug Rabson
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 <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 169901 2007-05-23 13:36:02Z cognet $");
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 170870 2007-06-17 04:37:57Z mjacob $");
29
30#include "opt_compat.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/clock.h>
36#include <sys/exec.h>

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

2048};
2049
2050int
2051ofreebsd32_sigstack(struct thread *td,
2052 struct ofreebsd32_sigstack_args *uap)
2053{
2054 struct sigstack32 s32;
2055 struct sigstack nss, oss;
29
30#include "opt_compat.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/bus.h>
35#include <sys/clock.h>
36#include <sys/exec.h>

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

2048};
2049
2050int
2051ofreebsd32_sigstack(struct thread *td,
2052 struct ofreebsd32_sigstack_args *uap)
2053{
2054 struct sigstack32 s32;
2055 struct sigstack nss, oss;
2056 int error = 0;
2056 int error = 0, unss;
2057
2058 if (uap->nss != NULL) {
2059 error = copyin(uap->nss, &s32, sizeof(s32));
2060 if (error)
2061 return (error);
2062 nss.ss_sp = PTRIN(s32.ss_sp);
2063 CP(s32, nss, ss_onstack);
2057
2058 if (uap->nss != NULL) {
2059 error = copyin(uap->nss, &s32, sizeof(s32));
2060 if (error)
2061 return (error);
2062 nss.ss_sp = PTRIN(s32.ss_sp);
2063 CP(s32, nss, ss_onstack);
2064 unss = 1;
2065 } else {
2066 unss = 0;
2064 }
2065 oss.ss_sp = td->td_sigstk.ss_sp;
2066 oss.ss_onstack = sigonstack(cpu_getstack(td));
2067 }
2068 oss.ss_sp = td->td_sigstk.ss_sp;
2069 oss.ss_onstack = sigonstack(cpu_getstack(td));
2067 if (uap->nss != NULL) {
2070 if (unss) {
2068 td->td_sigstk.ss_sp = nss.ss_sp;
2069 td->td_sigstk.ss_size = 0;
2071 td->td_sigstk.ss_sp = nss.ss_sp;
2072 td->td_sigstk.ss_size = 0;
2070 td->td_sigstk.ss_flags |= nss.ss_onstack & SS_ONSTACK;
2073 td->td_sigstk.ss_flags |= (nss.ss_onstack & SS_ONSTACK);
2071 td->td_pflags |= TDP_ALTSTACK;
2072 }
2073 if (uap->oss != NULL) {
2074 s32.ss_sp = PTROUT(oss.ss_sp);
2075 CP(oss, s32, ss_onstack);
2076 error = copyout(&s32, uap->oss, sizeof(s32));
2077 }
2078 return (error);

--- 251 unchanged lines hidden ---
2074 td->td_pflags |= TDP_ALTSTACK;
2075 }
2076 if (uap->oss != NULL) {
2077 s32.ss_sp = PTROUT(oss.ss_sp);
2078 CP(oss, s32, ss_onstack);
2079 error = copyout(&s32, uap->oss, sizeof(s32));
2080 }
2081 return (error);

--- 251 unchanged lines hidden ---