[sheepdog] [PATCH] Fix hardcode AMD64 assembly code (RSP)

Hitoshi Mitake mitake.hitoshi at gmail.com
Sun Jul 28 10:39:32 CEST 2013


At Sun, 28 Jul 2013 02:05:49 +0800,
YunQiang Su wrote:
> 
> RSP is a register name only for AMD64 (x86_64) platform,
> while on other platform it may be another name.
> 
> On i386 (x86_32) platform, it is "esp".
> On most of RISC platform (PowerPC, SPARC, MIPS, ARM, etc),
> it is "sp".

Please add your Signed-off-by tag here. It would be like this: 
Signed-off-by: YunQiang Su <wzssyqa at gmail.com>

> ---
>  include/logger.h | 23 ++++++++++++++++++++++-
>  lib/logger.c     |  5 -----
>  2 files changed, 22 insertions(+), 6 deletions(-)
> 
> diff --git a/include/logger.h b/include/logger.h
> index 79eb108..81691b2 100644
> --- a/include/logger.h
> +++ b/include/logger.h
> @@ -38,10 +38,31 @@ void log_write(int prio, const char *func, int line, const char *fmt, ...)
>  void set_thread_name(const char *name, bool show_idx);
>  void get_thread_name(char *name);
>  
> +#ifdef __i386__
> +#define SP_REG "esp"
> +#elif defined(__x86_64__)
> +#define SP_REG "rsp"
> +#elif defined(__mips__) || defined(__sparc__) || \
> +      defined (__arm__) || (defined __powerpc__) || \
> +      defined (__s390__) || (defined __s390x__) || \
> +      defined (__ia64__)
> +#define SP_REG "sp"
> +#endif

sheepdog cannot support ia64. Because sheepdog depends on urcu and
urcu doesn't support ia64.

I think supporting i386 and arm would be enough. Supporting other
architectures would be too costly, at least for now.

Thanks,
Hitoshi



More information about the sheepdog mailing list