diff options
Diffstat (limited to 'include/asm-i386/system.h')
| -rw-r--r-- | include/asm-i386/system.h | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 399145a247f2..d0d8d7448d88 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
| @@ -352,67 +352,6 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr, unsigned long l | |||
| 352 | 352 | ||
| 353 | #endif | 353 | #endif |
| 354 | 354 | ||
| 355 | #ifdef __KERNEL__ | ||
| 356 | struct alt_instr { | ||
| 357 | __u8 *instr; /* original instruction */ | ||
| 358 | __u8 *replacement; | ||
| 359 | __u8 cpuid; /* cpuid bit set for replacement */ | ||
| 360 | __u8 instrlen; /* length of original instruction */ | ||
| 361 | __u8 replacementlen; /* length of new instruction, <= instrlen */ | ||
| 362 | __u8 pad; | ||
| 363 | }; | ||
| 364 | #endif | ||
| 365 | |||
| 366 | /* | ||
| 367 | * Alternative instructions for different CPU types or capabilities. | ||
| 368 | * | ||
| 369 | * This allows to use optimized instructions even on generic binary | ||
| 370 | * kernels. | ||
| 371 | * | ||
| 372 | * length of oldinstr must be longer or equal the length of newinstr | ||
| 373 | * It can be padded with nops as needed. | ||
| 374 | * | ||
| 375 | * For non barrier like inlines please define new variants | ||
| 376 | * without volatile and memory clobber. | ||
| 377 | */ | ||
| 378 | #define alternative(oldinstr, newinstr, feature) \ | ||
| 379 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
| 380 | ".section .altinstructions,\"a\"\n" \ | ||
| 381 | " .align 4\n" \ | ||
| 382 | " .long 661b\n" /* label */ \ | ||
| 383 | " .long 663f\n" /* new instruction */ \ | ||
| 384 | " .byte %c0\n" /* feature bit */ \ | ||
| 385 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
| 386 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
| 387 | ".previous\n" \ | ||
| 388 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
| 389 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
| 390 | ".previous" :: "i" (feature) : "memory") | ||
| 391 | |||
| 392 | /* | ||
| 393 | * Alternative inline assembly with input. | ||
| 394 | * | ||
| 395 | * Pecularities: | ||
| 396 | * No memory clobber here. | ||
| 397 | * Argument numbers start with 1. | ||
| 398 | * Best is to use constraints that are fixed size (like (%1) ... "r") | ||
| 399 | * If you use variable sized constraints like "m" or "g" in the | ||
| 400 | * replacement maake sure to pad to the worst case length. | ||
| 401 | */ | ||
| 402 | #define alternative_input(oldinstr, newinstr, feature, input...) \ | ||
| 403 | asm volatile ("661:\n\t" oldinstr "\n662:\n" \ | ||
| 404 | ".section .altinstructions,\"a\"\n" \ | ||
| 405 | " .align 4\n" \ | ||
| 406 | " .long 661b\n" /* label */ \ | ||
| 407 | " .long 663f\n" /* new instruction */ \ | ||
| 408 | " .byte %c0\n" /* feature bit */ \ | ||
| 409 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
| 410 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
| 411 | ".previous\n" \ | ||
| 412 | ".section .altinstr_replacement,\"ax\"\n" \ | ||
| 413 | "663:\n\t" newinstr "\n664:\n" /* replacement */ \ | ||
| 414 | ".previous" :: "i" (feature), ##input) | ||
| 415 | |||
| 416 | /* | 355 | /* |
| 417 | * Force strict CPU ordering. | 356 | * Force strict CPU ordering. |
| 418 | * And yes, this is required on UP too when we're talking | 357 | * And yes, this is required on UP too when we're talking |
| @@ -558,5 +497,6 @@ static inline void sched_cacheflush(void) | |||
| 558 | } | 497 | } |
| 559 | 498 | ||
| 560 | extern unsigned long arch_align_stack(unsigned long sp); | 499 | extern unsigned long arch_align_stack(unsigned long sp); |
| 500 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); | ||
| 561 | 501 | ||
| 562 | #endif | 502 | #endif |
