On 03.04.2024 14:03, Juergen Gross wrote: > ASM_INT() is defined in arch/[arm|x86]/include/asm/asm_defns.h in > exactly the same way. Instead of replicating this definition for riscv > and ppc, move it to include/xen/linkage.h, where other arch agnostic > definitions for assembler code are living already.
And this is why I didn't make a change right away, back when noticing the duplication: Arch-agnostic really means ... > --- a/xen/include/xen/linkage.h > +++ b/xen/include/xen/linkage.h > @@ -60,6 +60,8 @@ > #define DATA_LOCAL(name, align...) \ > SYM(name, DATA, LOCAL, LASTARG(DATA_ALIGN, ## align), DATA_FILL) > > +#define ASM_INT(label, val) DATA(label, 4) .long (val); END(label) ... to avoid .long [1]. There's no arch-independent aspect guaranteeing that what .long emits matches "unsigned int" as used e.g. in the declaration of xen_config_data_size. The arch-agnostic directives are .dc.l and friends. Sadly Clang looks to support this only starting with version 4. Nevertheless, seeing that Andrew ack-ed the change already, it's perhaps good enough for the moment. If an obscure port appeared, the further abstraction could be taken care of by them. Jan [1] Note how in gas doc .long refers to .int, .int says "32-bit", just to then have a special case of H8/300 emitting 16-bit values. Things must have been confusing enough for someone to come and add .dc.?.