Deleted Added
full compact
cpu_machdep.c (197410) cpu_machdep.c (198507)
1/*-
2 * Copyright (c) 1992 Terrence R. Lambert.
3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * William Jolitz.
8 *

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

33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
38 */
39
40#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1992 Terrence R. Lambert.
3 * Copyright (c) 1982, 1987, 1990 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * William Jolitz.
8 *

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

33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
38 */
39
40#include <sys/cdefs.h>
41__FBSDID("$FreeBSD: head/sys/i386/i386/machdep.c 197410 2009-09-22 16:51:00Z jhb $");
41__FBSDID("$FreeBSD: head/sys/i386/i386/machdep.c 198507 2009-10-27 10:47:58Z kib $");
42
43#include "opt_apic.h"
44#include "opt_atalk.h"
45#include "opt_compat.h"
46#include "opt_cpu.h"
47#include "opt_ddb.h"
48#include "opt_inet.h"
49#include "opt_ipx.h"

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

751 struct thread *td;
752 struct osigreturn_args /* {
753 struct osigcontext *sigcntxp;
754 } */ *uap;
755{
756 struct osigcontext sc;
757 struct trapframe *regs;
758 struct osigcontext *scp;
42
43#include "opt_apic.h"
44#include "opt_atalk.h"
45#include "opt_compat.h"
46#include "opt_cpu.h"
47#include "opt_ddb.h"
48#include "opt_inet.h"
49#include "opt_ipx.h"

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

751 struct thread *td;
752 struct osigreturn_args /* {
753 struct osigcontext *sigcntxp;
754 } */ *uap;
755{
756 struct osigcontext sc;
757 struct trapframe *regs;
758 struct osigcontext *scp;
759 struct proc *p = td->td_proc;
760 int eflags, error;
761 ksiginfo_t ksi;
762
763 regs = td->td_frame;
764 error = copyin(uap->sigcntxp, &sc, sizeof(sc));
765 if (error != 0)
766 return (error);
767 scp = &sc;

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

851 regs->tf_cs = scp->sc_cs;
852 regs->tf_ss = scp->sc_ss;
853 regs->tf_isp = scp->sc_isp;
854 regs->tf_ebp = scp->sc_fp;
855 regs->tf_esp = scp->sc_sp;
856 regs->tf_eip = scp->sc_pc;
857 regs->tf_eflags = eflags;
858
759 int eflags, error;
760 ksiginfo_t ksi;
761
762 regs = td->td_frame;
763 error = copyin(uap->sigcntxp, &sc, sizeof(sc));
764 if (error != 0)
765 return (error);
766 scp = &sc;

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

850 regs->tf_cs = scp->sc_cs;
851 regs->tf_ss = scp->sc_ss;
852 regs->tf_isp = scp->sc_isp;
853 regs->tf_ebp = scp->sc_fp;
854 regs->tf_esp = scp->sc_sp;
855 regs->tf_eip = scp->sc_pc;
856 regs->tf_eflags = eflags;
857
859 PROC_LOCK(p);
860#if defined(COMPAT_43)
861 if (scp->sc_onstack & 1)
862 td->td_sigstk.ss_flags |= SS_ONSTACK;
863 else
864 td->td_sigstk.ss_flags &= ~SS_ONSTACK;
865#endif
858#if defined(COMPAT_43)
859 if (scp->sc_onstack & 1)
860 td->td_sigstk.ss_flags |= SS_ONSTACK;
861 else
862 td->td_sigstk.ss_flags &= ~SS_ONSTACK;
863#endif
866 SIGSETOLD(td->td_sigmask, scp->sc_mask);
867 SIG_CANTMASK(td->td_sigmask);
868 signotify(td);
869 PROC_UNLOCK(p);
864 kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL,
865 SIGPROCMASK_OLD);
870 return (EJUSTRETURN);
871}
872#endif /* COMPAT_43 */
873
874#ifdef COMPAT_FREEBSD4
875/*
876 * MPSAFE
877 */
878int
879freebsd4_sigreturn(td, uap)
880 struct thread *td;
881 struct freebsd4_sigreturn_args /* {
882 const ucontext4 *sigcntxp;
883 } */ *uap;
884{
885 struct ucontext4 uc;
866 return (EJUSTRETURN);
867}
868#endif /* COMPAT_43 */
869
870#ifdef COMPAT_FREEBSD4
871/*
872 * MPSAFE
873 */
874int
875freebsd4_sigreturn(td, uap)
876 struct thread *td;
877 struct freebsd4_sigreturn_args /* {
878 const ucontext4 *sigcntxp;
879 } */ *uap;
880{
881 struct ucontext4 uc;
886 struct proc *p = td->td_proc;
887 struct trapframe *regs;
882 struct trapframe *regs;
888 const struct ucontext4 *ucp;
883 struct ucontext4 *ucp;
889 int cs, eflags, error;
890 ksiginfo_t ksi;
891
892 error = copyin(uap->sigcntxp, &uc, sizeof(uc));
893 if (error != 0)
894 return (error);
895 ucp = &uc;
896 regs = td->td_frame;

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

968 ksi.ksi_addr = (void *)regs->tf_eip;
969 trapsignal(td, &ksi);
970 return (EINVAL);
971 }
972
973 bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs));
974 }
975
884 int cs, eflags, error;
885 ksiginfo_t ksi;
886
887 error = copyin(uap->sigcntxp, &uc, sizeof(uc));
888 if (error != 0)
889 return (error);
890 ucp = &uc;
891 regs = td->td_frame;

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

963 ksi.ksi_addr = (void *)regs->tf_eip;
964 trapsignal(td, &ksi);
965 return (EINVAL);
966 }
967
968 bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs));
969 }
970
976 PROC_LOCK(p);
977#if defined(COMPAT_43)
978 if (ucp->uc_mcontext.mc_onstack & 1)
979 td->td_sigstk.ss_flags |= SS_ONSTACK;
980 else
981 td->td_sigstk.ss_flags &= ~SS_ONSTACK;
982#endif
971#if defined(COMPAT_43)
972 if (ucp->uc_mcontext.mc_onstack & 1)
973 td->td_sigstk.ss_flags |= SS_ONSTACK;
974 else
975 td->td_sigstk.ss_flags &= ~SS_ONSTACK;
976#endif
983
984 td->td_sigmask = ucp->uc_sigmask;
985 SIG_CANTMASK(td->td_sigmask);
986 signotify(td);
987 PROC_UNLOCK(p);
977 kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
988 return (EJUSTRETURN);
989}
990#endif /* COMPAT_FREEBSD4 */
991
992/*
993 * MPSAFE
994 */
995int
996sigreturn(td, uap)
997 struct thread *td;
998 struct sigreturn_args /* {
999 const struct __ucontext *sigcntxp;
1000 } */ *uap;
1001{
1002 ucontext_t uc;
978 return (EJUSTRETURN);
979}
980#endif /* COMPAT_FREEBSD4 */
981
982/*
983 * MPSAFE
984 */
985int
986sigreturn(td, uap)
987 struct thread *td;
988 struct sigreturn_args /* {
989 const struct __ucontext *sigcntxp;
990 } */ *uap;
991{
992 ucontext_t uc;
1003 struct proc *p = td->td_proc;
1004 struct trapframe *regs;
993 struct trapframe *regs;
1005 const ucontext_t *ucp;
994 ucontext_t *ucp;
1006 int cs, eflags, error, ret;
1007 ksiginfo_t ksi;
1008
1009 error = copyin(uap->sigcntxp, &uc, sizeof(uc));
1010 if (error != 0)
1011 return (error);
1012 ucp = &uc;
1013 regs = td->td_frame;

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

1089 }
1090
1091 ret = set_fpcontext(td, &ucp->uc_mcontext);
1092 if (ret != 0)
1093 return (ret);
1094 bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs));
1095 }
1096
995 int cs, eflags, error, ret;
996 ksiginfo_t ksi;
997
998 error = copyin(uap->sigcntxp, &uc, sizeof(uc));
999 if (error != 0)
1000 return (error);
1001 ucp = &uc;
1002 regs = td->td_frame;

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

1078 }
1079
1080 ret = set_fpcontext(td, &ucp->uc_mcontext);
1081 if (ret != 0)
1082 return (ret);
1083 bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs));
1084 }
1085
1097 PROC_LOCK(p);
1098#if defined(COMPAT_43)
1099 if (ucp->uc_mcontext.mc_onstack & 1)
1100 td->td_sigstk.ss_flags |= SS_ONSTACK;
1101 else
1102 td->td_sigstk.ss_flags &= ~SS_ONSTACK;
1103#endif
1104
1086#if defined(COMPAT_43)
1087 if (ucp->uc_mcontext.mc_onstack & 1)
1088 td->td_sigstk.ss_flags |= SS_ONSTACK;
1089 else
1090 td->td_sigstk.ss_flags &= ~SS_ONSTACK;
1091#endif
1092
1105 td->td_sigmask = ucp->uc_sigmask;
1106 SIG_CANTMASK(td->td_sigmask);
1107 signotify(td);
1108 PROC_UNLOCK(p);
1093 kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
1109 return (EJUSTRETURN);
1110}
1111
1112/*
1113 * Machine dependent boot() routine
1114 *
1115 * I haven't seen anything to put here yet
1116 * Possibly some stuff might be grafted back here from boot()

--- 2595 unchanged lines hidden ---
1094 return (EJUSTRETURN);
1095}
1096
1097/*
1098 * Machine dependent boot() routine
1099 *
1100 * I haven't seen anything to put here yet
1101 * Possibly some stuff might be grafted back here from boot()

--- 2595 unchanged lines hidden ---