Re: [RFC, PATCH 4/24] i386 Vmi inline implementation

Andi Kleen
2006-03-22T20:59:29Z

On Monday 13 March 2006 19:02, Zachary Amsden wrote:

> +#define MAKESTR(x) #x
> +#define XSTR(x) MAKESTR(x)
> +#define XCONC(args...) args
> +#define CONCSTR(x...) #x
> +#define XCSTR(x...) CONCSTR(x)

We have legions of these all over the tree. How about you put
them into some central file and gc a few?

> +/*
> + * Propagate these definitions as strings up to C code for convenient use
> + * in stringized assembler as pseudo-mnemonics; we must emit assembler
> + * directives to generate equates for the VMI_CALL_XXX symbols, since they
> + * will not be available otherwise to the assembler, and we can't emit
> + * the C versions of these functions from within an inline assembler
> + * string.
> + */
> +asm(".equ VMI_CALL_CUR, 0;\n\t");

The standard way to do this is to use asm-offsets.c

> +#define VDEF(call) \
> + asm (".equ VMI_CALL_" #call ", VMI_CALL_CUR;\n\t"); \
> + asm (".equ VMI_CALL_CUR, VMI_CALL_CUR+1;\n\t");
> +VMI_CALLS

Hmmm? This doesn't look like something a header file should be doing.

How about you put that big list and the definition into a .c ?

> +#if defined(CONFIG_VMI_C_CONVENTION)

I don't think that file can be reviewed in any meaningful way before
you don't get rid of the macro mess and the unneeded calling conventions.

-Andi