[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/riscv: init bss section



On Fri, 2023-02-24 at 15:56 +0100, Jan Beulich wrote:
> On 24.02.2023 15:48, Oleksii Kurochko wrote:
> > --- a/xen/arch/riscv/setup.c
> > +++ b/xen/arch/riscv/setup.c
> > @@ -24,6 +24,18 @@ static void test_macros_from_bug_h(void)
> >      early_printk("WARN is most likely working\n");
> >  }
> >  
> > +static void __init init_bss(void)
> > +{
> > +    extern char __bss_start;
> > +    extern char __bss_end;
> 
> Better use [] and then perhaps omit the & operators further down.
> However, I thought we have a compiler warning option in use which
> precludes extern declarations which aren't at file scope. Even if
> I'm misremembering, perhaps better to move them.
Thanks. I will update the code then to use [].
> 
> > +    char *bss = &__bss_start;
> > +
> > +    while ( bss < &__bss_end ) {
> > +        *bss = 0;
> > +        bss++;
> > +    }
> > +}
> 
> If you're sure you can defer this until being in C code, why not use
> memset()?
I had an issue with from <xen/string.h>


#ifndef __HAVE_ARCH_MEMSET
#define memset(s, c, n) __builtin_memset(s, c, n)
#endif

but there is no issue any more so I think I can use memset().
> 
> Jan
~ Oleksii



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.