diff options
author | kib <kib@FreeBSD.org> | 2015-08-05 07:21:44 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-08-05 07:21:44 +0000 |
commit | 9428730d60c2668836c55e3ba688233695b2ddad (patch) | |
tree | 4c5885e719c8e45996b51e5a65e18711a1ded8f8 /sys | |
parent | 861d78f2a3cbb714d3930a5d2e820c252bfbaf1d (diff) | |
download | FreeBSD-src-9428730d60c2668836c55e3ba688233695b2ddad.zip FreeBSD-src-9428730d60c2668836c55e3ba688233695b2ddad.tar.gz |
MFC r285041:
Use single instance of the identical INKERNEL() and PMC_IN_KERNEL()
macros on amd64 and i386. On i386, correct the lowest kernel address.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/include/param.h | 3 | ||||
-rw-r--r-- | sys/amd64/include/pmc_mdep.h | 4 | ||||
-rw-r--r-- | sys/amd64/include/stack.h | 2 | ||||
-rw-r--r-- | sys/cddl/dev/dtrace/i386/dtrace_isa.c | 3 | ||||
-rw-r--r-- | sys/i386/include/param.h | 3 | ||||
-rw-r--r-- | sys/i386/include/pmc_mdep.h | 3 | ||||
-rw-r--r-- | sys/i386/include/stack.h | 2 |
7 files changed, 8 insertions, 12 deletions
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; |