[PATCH v3 07/13] x86/um: nommu: process/thread handling
Johannes Berg
johannes at sipsolutions.net
Thu Dec 5 05:58:52 PST 2024
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.
johannes
More information about the linux-um
mailing list