x86/alt: Break out alternative-asm into a separate header file

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
master commit: 9d7b4351d3
master date: 2018-01-05 19:57:07 +0000
This commit is contained in:
Andrew Cooper authored and Jan Beulich committed 2018-02-08 12:39:38 +01:00
1 parent 2aff8d5e73
commit 3efcd7fb40
2 files changed
+34 -10

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#ifndef _ASM_X86_ALTERNATIVE_ASM_H_
#define _ASM_X86_ALTERNATIVE_ASM_H_
#ifdef __ASSEMBLY__
/*
* Issue one struct alt_instr descriptor entry (need to put it into
* the section .altinstructions, see below). This entry contains
* enough information for the alternatives patching code to patch an
* instruction. See apply_alternatives().
*/
.macro altinstruction_entry orig alt feature orig_len alt_len
.long \orig - .
.long \alt - .
.word \feature
.byte \orig_len
.byte \alt_len
.endm
#endif /* __ASSEMBLY__ */
#endif /* _ASM_X86_ALTERNATIVE_ASM_H_ */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/
+3 -10
View File
@@ -1,17 +1,10 @@
#ifndef __X86_ALTERNATIVE_H__
#define __X86_ALTERNATIVE_H__
#include <asm/alternative-asm.h>
#include <asm/nops.h>
#ifdef __ASSEMBLY__
.macro altinstruction_entry orig alt feature orig_len alt_len
.long \orig - .
.long \alt - .
.word \feature
.byte \orig_len
.byte \alt_len
.endm
#else
#ifndef __ASSEMBLY__
#include <xen/stringify.h>
#include <xen/types.h>
@@ -145,6 +138,6 @@ extern void alternative_instructions(void);
/* Use this macro(s) if you need more than one output parameter. */
#define ASM_OUTPUT2(a...) a
#endif /* __ASSEMBLY__ */
#endif /* !__ASSEMBLY__ */
#endif /* __X86_ALTERNATIVE_H__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.