[PATCH v3 07/13] x86/um: nommu: process/thread handling
Hajime Tazaki
thehajime at gmail.com
Thu Dec 5 18:49:51 PST 2024
On Thu, 05 Dec 2024 22:58:52 +0900,
Johannes Berg wrote:
>
> On Thu, 2024-12-05 at 22:56 +0900, Hajime Tazaki wrote:
> >
> > > > +++ b/arch/x86/um/asm/processor.h
> > > > @@ -38,6 +38,18 @@ static __always_inline void cpu_relax(void)
> > > >
> > > > #define task_pt_regs(t) (&(t)->thread.regs)
> > > >
> > > > +#ifndef CONFIG_MMU
> > > > +#define task_top_of_stack(task) \
> > > > +({ \
> > > > + unsigned long __ptr = (unsigned long)task->stack; \
> > > > + __ptr += THREAD_SIZE; \
> > > > + __ptr; \
> > > > +})
> > > > +
> > > > +extern long current_top_of_stack;
> > > > +extern long current_ptregs;
> > > > +#endif
> > >
> > > no need for "extern".
> > >
> > > you only use all that once, does it need to be here?
> >
> > sorry, I don't understand both of these comments; could you care to
> > elaborate ?
>
> Sorry, you obviously do need 'extern', I was clearly confused.
>
> Regarding the task_top_of_stack() macro, I thought you only used it in
> one C file, so I'm not sure it should be in a header file that's
> generally included across the kernel, rather than a private header file
> or just in the C file itself.
I understand, thanks.
I'll move the macro to a different file.
-- Hajime
More information about the linux-um
mailing list