Use single instance of the identical INKERNEL() and PMC_IN_KERNEL()
macros on amd64 and i386. Move the definition to machine/param.h. kgdb defines INKERNEL() too, the conflict is resolved by renaming kgdb version to PINKERNEL(). On i386, correct the lowest kernel address. After the shared page was introduced, USRSTACK no longer points to the last user address + 1 [*] Submitted by: Oliver Pinter [*] Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
a380ef6a02
commit
6fdfd88220
@ -76,7 +76,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)
|
||||
@ -296,7 +296,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");
|
||||
@ -319,7 +319,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");
|
||||
|
@ -149,4 +149,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_ */
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 *);
|
||||
|
@ -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_ */
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user