kstack_contains(): account for struct pcb on stack
for arm64, arm, powerpc, and riscv Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38320
This commit is contained in:
parent
3f08bd5653
commit
83a49712af
@ -78,7 +78,8 @@ static __inline bool
|
|||||||
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
||||||
{
|
{
|
||||||
return (va >= td->td_kstack && va + len >= va &&
|
return (va >= td->td_kstack && va + len >= va &&
|
||||||
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE);
|
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE -
|
||||||
|
sizeof(struct pcb));
|
||||||
}
|
}
|
||||||
#endif /* _SYS_PROC_H_ */
|
#endif /* _SYS_PROC_H_ */
|
||||||
|
|
||||||
|
@ -53,7 +53,8 @@ static __inline bool
|
|||||||
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
||||||
{
|
{
|
||||||
return (va >= td->td_kstack && va + len >= va &&
|
return (va >= td->td_kstack && va + len >= va &&
|
||||||
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE);
|
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE -
|
||||||
|
sizeof(struct pcb));
|
||||||
}
|
}
|
||||||
#endif /* _SYS_PROC_H_ */
|
#endif /* _SYS_PROC_H_ */
|
||||||
|
|
||||||
|
@ -48,7 +48,8 @@ static __inline bool
|
|||||||
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
||||||
{
|
{
|
||||||
return (va >= td->td_kstack && va + len >= va &&
|
return (va >= td->td_kstack && va + len >= va &&
|
||||||
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE);
|
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE -
|
||||||
|
sizeof(struct pcb));
|
||||||
}
|
}
|
||||||
#endif /* _SYS_PROC_H_ */
|
#endif /* _SYS_PROC_H_ */
|
||||||
|
|
||||||
|
@ -63,7 +63,8 @@ static __inline bool
|
|||||||
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
kstack_contains(struct thread *td, vm_offset_t va, size_t len)
|
||||||
{
|
{
|
||||||
return (va >= td->td_kstack && va + len >= va &&
|
return (va >= td->td_kstack && va + len >= va &&
|
||||||
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE);
|
va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE -
|
||||||
|
sizeof(struct pcb));
|
||||||
}
|
}
|
||||||
#endif /* _SYS_PROC_H_ */
|
#endif /* _SYS_PROC_H_ */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user