On 1/28/15 7:54 PM, Yue Chen wrote:
> How can we know the kernel stack ranges for user process and kernel threads
> under FreeBSD x86_64?
> It seems that each kernel stack has two pages (IA-32) to use. Does x86_64
> still have two pages or more? And how can we find the address of these two
> pages from a kernel module?

In 'struct thread' there is td_kstack_pages and td_kstack.  If you grep
for those and see where they are initialized that will lead you to find
in the source what the defaults are for amd64 (and you can also use
those in your kernel module).  Note that some kthreads have a different
sized stack, so using the members in struct thread is probably what you
want to do regardless.

John Baldwin
freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to