summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt.c6
-rw-r--r--sys/amd64/include/param.h3
-rw-r--r--sys/amd64/include/pmc_mdep.h4
-rw-r--r--sys/amd64/include/stack.h2
-rw-r--r--sys/cddl/dev/dtrace/i386/dtrace_isa.c3
-rw-r--r--sys/i386/include/param.h3
-rw-r--r--sys/i386/include/pmc_mdep.h3
-rw-r--r--sys/i386/include/stack.h2
8 files changed, 11 insertions, 15 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/trgt.c b/gnu/usr.bin/gdb/kgdb/trgt.c
index 85065cc..88a8184 100644
--- a/gnu/usr.bin/gdb/kgdb/trgt.c
+++ b/gnu/usr.bin/gdb/kgdb/trgt.c
@@ -64,7 +64,7 @@ kvm_t *kvm;
static char kvm_err[_POSIX2_LINE_MAX];
#define KERNOFF (kgdb_kernbase ())
-#define INKERNEL(x) ((x) >= KERNOFF)
+#define PINKERNEL(x) ((x) >= KERNOFF)
static CORE_ADDR
kgdb_kernbase (void)
@@ -284,7 +284,7 @@ kgdb_set_proc_cmd (char *arg, int from_tty)
addr = (CORE_ADDR) parse_and_eval_address (arg);
- if (!INKERNEL (addr)) {
+ if (!PINKERNEL (addr)) {
thr = kgdb_thr_lookup_pid((int)addr);
if (thr == NULL)
error ("invalid pid");
@@ -307,7 +307,7 @@ kgdb_set_tid_cmd (char *arg, int from_tty)
addr = (CORE_ADDR) parse_and_eval_address (arg);
- if (kvm != NULL && INKERNEL (addr)) {
+ if (kvm != NULL && PINKERNEL (addr)) {
thr = kgdb_thr_lookup_taddr(addr);
if (thr == NULL)
error("invalid thread address");
diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h
index 3d4722b..0e70d2a 100644
--- a/sys/amd64/include/param.h
+++ b/sys/amd64/include/param.h
@@ -143,4 +143,7 @@
#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024))
+#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \
+ || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS))
+
#endif /* !_AMD64_INCLUDE_PARAM_H_ */
diff --git a/sys/amd64/include/pmc_mdep.h b/sys/amd64/include/pmc_mdep.h
index 73c93fe..22249c1 100644
--- a/sys/amd64/include/pmc_mdep.h
+++ b/sys/amd64/include/pmc_mdep.h
@@ -113,9 +113,7 @@ union pmc_md_pmc {
#define PMC_IN_KERNEL_STACK(S,START,END) \
((S) >= (START) && (S) < (END))
-#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \
- (va) < DMAP_MAX_ADDRESS) || ((va) >= VM_MIN_KERNEL_ADDRESS && \
- (va) < VM_MAX_KERNEL_ADDRESS))
+#define PMC_IN_KERNEL(va) INKERNEL(va)
#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)
diff --git a/sys/amd64/include/stack.h b/sys/amd64/include/stack.h
index 24e2547..8297eae 100644
--- a/sys/amd64/include/stack.h
+++ b/sys/amd64/include/stack.h
@@ -32,8 +32,6 @@
/*
* Stack trace.
*/
-#define INKERNEL(va) (((va) >= DMAP_MIN_ADDRESS && (va) < DMAP_MAX_ADDRESS) \
- || ((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS))
struct amd64_frame {
struct amd64_frame *f_frame;
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_isa.c b/sys/cddl/dev/dtrace/i386/dtrace_isa.c
index 6c261bf..04f205c 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_isa.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_isa.c
@@ -47,9 +47,6 @@
extern uintptr_t kernbase;
uintptr_t kernelbase = (uintptr_t) &kernbase;
-#define INKERNEL(va) (((vm_offset_t)(va)) >= USRSTACK && \
- ((vm_offset_t)(va)) < VM_MAX_KERNEL_ADDRESS)
-
uint8_t dtrace_fuword8_nocheck(void *);
uint16_t dtrace_fuword16_nocheck(void *);
uint32_t dtrace_fuword32_nocheck(void *);
diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
index 54477c1..b3fd85f 100644
--- a/sys/i386/include/param.h
+++ b/sys/i386/include/param.h
@@ -157,4 +157,7 @@
#define pgtok(x) ((x) * (PAGE_SIZE / 1024))
+#define INKERNEL(va) (((vm_offset_t)(va)) >= VM_MAXUSER_ADDRESS && \
+ ((vm_offset_t)(va)) < VM_MAX_KERNEL_ADDRESS)
+
#endif /* !_I386_INCLUDE_PARAM_H_ */
diff --git a/sys/i386/include/pmc_mdep.h b/sys/i386/include/pmc_mdep.h
index 5ce791a..ff057ce 100644
--- a/sys/i386/include/pmc_mdep.h
+++ b/sys/i386/include/pmc_mdep.h
@@ -138,8 +138,7 @@ struct pmc_mdep;
#define PMC_IN_KERNEL_STACK(S,START,END) \
((S) >= (START) && (S) < (END))
-#define PMC_IN_KERNEL(va) (((va) >= USRSTACK) && \
- ((va) < VM_MAX_KERNEL_ADDRESS))
+#define PMC_IN_KERNEL(va) INKERNEL(va)
#define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS)
diff --git a/sys/i386/include/stack.h b/sys/i386/include/stack.h
index 78caae0..f63fc4b 100644
--- a/sys/i386/include/stack.h
+++ b/sys/i386/include/stack.h
@@ -32,8 +32,6 @@
/*
* Stack trace.
*/
-#define INKERNEL(va) (((vm_offset_t)(va)) >= USRSTACK && \
- ((vm_offset_t)(va)) < VM_MAX_KERNEL_ADDRESS)
struct i386_frame {
struct i386_frame *f_frame;
OpenPOWER on IntegriCloud