import __stringify from linux
update the current code Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
683e4ef357
commit
5156e781bd
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include <asm/ptrace.h>
|
#include <asm/ptrace.h>
|
||||||
#include <asm/types.h>
|
#include <asm/types.h>
|
||||||
|
#include <linux/stringify.h>
|
||||||
|
|
||||||
/* Machine State Register (MSR) Fields */
|
/* Machine State Register (MSR) Fields */
|
||||||
|
|
||||||
|
@ -887,22 +888,19 @@ n:
|
||||||
|
|
||||||
/* Macros for setting and retrieving special purpose registers */
|
/* Macros for setting and retrieving special purpose registers */
|
||||||
|
|
||||||
#define stringify(s) tostring(s)
|
|
||||||
#define tostring(s) #s
|
|
||||||
|
|
||||||
#define mfdcr(rn) ({unsigned int rval; \
|
#define mfdcr(rn) ({unsigned int rval; \
|
||||||
asm volatile("mfdcr %0," stringify(rn) \
|
asm volatile("mfdcr %0," __stringify(rn) \
|
||||||
: "=r" (rval)); rval;})
|
: "=r" (rval)); rval;})
|
||||||
#define mtdcr(rn, v) asm volatile("mtdcr " stringify(rn) ",%0" : : "r" (v))
|
#define mtdcr(rn, v) asm volatile("mtdcr " __stringify(rn) ",%0" : : "r" (v))
|
||||||
|
|
||||||
#define mfmsr() ({unsigned int rval; \
|
#define mfmsr() ({unsigned int rval; \
|
||||||
asm volatile("mfmsr %0" : "=r" (rval)); rval;})
|
asm volatile("mfmsr %0" : "=r" (rval)); rval;})
|
||||||
#define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v))
|
#define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v))
|
||||||
|
|
||||||
#define mfspr(rn) ({unsigned int rval; \
|
#define mfspr(rn) ({unsigned int rval; \
|
||||||
asm volatile("mfspr %0," stringify(rn) \
|
asm volatile("mfspr %0," __stringify(rn) \
|
||||||
: "=r" (rval)); rval;})
|
: "=r" (rval)); rval;})
|
||||||
#define mtspr(rn, v) asm volatile("mtspr " stringify(rn) ",%0" : : "r" (v))
|
#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
|
||||||
|
|
||||||
#define tlbie(v) asm volatile("tlbie %0 \n sync" : : "r" (v))
|
#define tlbie(v) asm volatile("tlbie %0 \n sync" : : "r" (v))
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#define __COMMAND_H
|
#define __COMMAND_H
|
||||||
|
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
|
#include <linux/stringify.h>
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
|
@ -75,10 +76,6 @@ void barebox_cmd_usage(struct command *cmdtp);
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
#define __stringify_1(x) #x
|
|
||||||
#define __stringify(x) __stringify_1(x)
|
|
||||||
|
|
||||||
|
|
||||||
#define Struct_Section __attribute__ ((unused,section (".barebox_cmd")))
|
#define Struct_Section __attribute__ ((unused,section (".barebox_cmd")))
|
||||||
|
|
||||||
#define BAREBOX_CMD_START(_name) \
|
#define BAREBOX_CMD_START(_name) \
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#ifndef __LINUX_STRINGIFY_H
|
||||||
|
#define __LINUX_STRINGIFY_H
|
||||||
|
|
||||||
|
/* Indirect stringification. Doing two levels allows the parameter to be a
|
||||||
|
* macro itself. For example, compile with -DFOO=bar, __stringify(FOO)
|
||||||
|
* converts to "bar".
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define __stringify_1(x...) #x
|
||||||
|
#define __stringify(x...) __stringify_1(x)
|
||||||
|
|
||||||
|
#endif /* !__LINUX_STRINGIFY_H */
|
Loading…
Reference in New Issue