-/* $OpenBSD: proc.h,v 1.12 2016/05/15 23:37:42 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.13 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.2 1995/03/24 15:01:36 cgd Exp $ */
/*
struct mdbpt md_sstep[2]; /* two breakpoints for sstep */
};
-#define __HAVE_MD_TCB
-
/*
* md_flags usage
* --------------
-/* $OpenBSD: proc.h,v 1.8 2014/03/29 18:09:28 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.9 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */
/*
#define MDP_IRET 0x0002 /* return via iret, not sysret */
/* (iret can restore r11 and rcx) */
-#define __HAVE_MD_TCB
-
#endif /* _MACHINE_PROC_H_ */
-/* $OpenBSD: proc.h,v 1.4 2016/09/24 21:02:31 patrick Exp $ */
+/* $OpenBSD: proc.h,v 1.5 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.5 2003/03/01 04:36:39 thorpej Exp $ */
/*
void *pmc_state; /* port-specific pmc state */
};
-#define __HAVE_MD_TCB
-
#endif /* _ARM_PROC_H_ */
-/* $OpenBSD: proc.h,v 1.1 2016/12/17 23:38:33 patrick Exp $ */
+/* $OpenBSD: proc.h,v 1.2 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */
/*
volatile int md_astpending;
};
-#define __HAVE_MD_TCB
-
#endif /* _MACHINE_PROC_H_ */
-/* $OpenBSD: proc.h,v 1.5 2011/11/08 15:39:50 kettenis Exp $ */
+/* $OpenBSD: proc.h,v 1.6 2017/04/13 03:52:25 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
u_int md_bpsave[2];
};
-#define __HAVE_MD_TCB
-
/* md_flags */
-/* $OpenBSD: proc.h,v 1.6 2011/12/24 04:27:56 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.7 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.10 1995/08/06 05:33:23 mycroft Exp $ */
/*
/* md_flags */
#define MDP_USEDFPU 0x0001 /* has used the FPU */
-
-#define __HAVE_MD_TCB
-/* $OpenBSD: proc.h,v 1.7 2014/03/18 22:36:34 miod Exp $ */
+/* $OpenBSD: proc.h,v 1.8 2017/04/13 03:52:25 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
u_int md_bp1save;
};
-#define __HAVE_MD_TCB
-
#endif /* _M88K_PROC_H_ */
-/* $OpenBSD: proc.h,v 1.10 2016/08/16 13:03:58 visa Exp $ */
+/* $OpenBSD: proc.h,v 1.11 2017/04/13 03:52:25 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
volatile int md_astpending; /* AST pending for this process */
int md_flags; /* machine-dependent flags */
vaddr_t md_uarea; /* allocated uarea virtual addr */
+ void *md_tcb; /* user-space thread-control-block */
/* ptrace fields */
vaddr_t md_ss_addr; /* single step address */
-/* $OpenBSD: tcb.h,v 1.1 2011/10/27 04:01:17 guenther Exp $ */
+/* $OpenBSD: tcb.h,v 1.2 2017/04/13 03:52:25 guenther Exp $ */
/*
* Copyright (c) 2011 Philip Guenther <guenther@openbsd.org>
#ifdef _KERNEL
-#error "not yet"
+/* Not a real register; just saved in struct mdproc */
+#define TCB_SET(p, addr) ((p)->p_md.md_tcb = (addr))
+#define TCB_GET(p) ((p)->p_md.md_tcb)
#else /* _KERNEL */
-/* $OpenBSD: vm_machdep.c,v 1.34 2017/02/12 04:55:08 guenther Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.35 2017/04/13 03:52:25 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
*/
if (stack != NULL)
p2->p_md.md_regs->sp = (u_int64_t)stack;
- if (tcb != NULL)
- TCB_SET(p2, tcb);
+ p2->p_md.md_tcb = tcb != NULL ? tcb : p1->p_md.md_tcb;
/*
* Copy the process control block to the new proc and
-/* $OpenBSD: proc.h,v 1.7 2014/03/29 18:09:30 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.8 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.1 1996/09/30 16:34:31 ws Exp $ */
/*-
volatile int md_astpending;
};
-#define __HAVE_MD_TCB
-
#endif /* _POWERPC_PROC_H_ */
-/* $OpenBSD: proc.h,v 1.3 2016/05/18 20:21:13 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.4 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.10 2005/12/11 12:18:58 christos Exp $ */
/*
struct md_upte md_upte[UPAGES * 2];
};
-#define __HAVE_MD_TCB
-
/* md_flags */
#define MDP_USEDFPU 0x0001 /* has used the FPU */
#define MDP_STEP 0x0002 /* single step */
struct fpstate64 *md_fpstate; /* fpu state, if any; always resident */
volatile int md_astpending;
};
-
-#define __HAVE_MD_TCB
-/* $OpenBSD: kern_exec.c,v 1.187 2017/02/11 19:51:06 guenther Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.188 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
#include <sys/syscallargs.h>
#include <uvm/uvm_extern.h>
-
-#ifdef __HAVE_MD_TCB
-# include <machine/tcb.h>
-#endif
+#include <machine/tcb.h>
const struct kmem_va_mode kv_exec = {
.kv_wait = 1,
-/* $OpenBSD: kern_fork.c,v 1.195 2017/02/12 04:55:08 guenther Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.196 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
#include <sys/syscallargs.h>
#include <uvm/uvm.h>
-
-#ifdef __HAVE_MD_TCB
-# include <machine/tcb.h>
-#endif
+#include <machine/tcb.h>
int nprocesses = 1; /* process 0 */
int nthreads = 1; /* proc 0 */
-/* $OpenBSD: kern_prot.c,v 1.67 2016/11/07 00:26:32 guenther Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.68 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
#include <sys/mount.h>
#include <sys/syscallargs.h>
-
-#ifdef __HAVE_MD_TCB
-# include <machine/tcb.h>
-#endif
+#include <machine/tcb.h>
inline void
crset(struct ucred *newcr, const struct ucred *cr)
-/* $OpenBSD: kern_sig.c,v 1.208 2017/01/24 00:58:55 mpi Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.209 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
#include <sys/syscallargs.h>
#include <uvm/uvm_extern.h>
-
-#ifdef __HAVE_MD_TCB
-# include <machine/tcb.h>
-#endif
+#include <machine/tcb.h>
int filt_sigattach(struct knote *kn);
void filt_sigdetach(struct knote *kn);
-/* $OpenBSD: proc.h,v 1.236 2017/03/05 06:40:18 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.237 2017/04/13 03:52:25 guenther Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
u_char p_usrpri; /* User-priority based on p_estcpu and ps_nice. */
int p_pledge_syscall; /* Cache of current syscall */
-#ifndef __HAVE_MD_TCB
- void *p_tcb; /* user-space thread-control-block address */
-# define TCB_SET(p, addr) ((p)->p_tcb = (addr))
-# define TCB_GET(p) ((p)->p_tcb)
-#endif
-
struct ucred *p_ucred; /* cached credentials */
struct sigaltstack p_sigstk; /* sp & on stack state variable */