Skip to content

Commit a11a842

Browse files
dpaoliellosivadeilra
authored andcommitted
Apply 0028-cstd-asm.patch
1 parent 0917563 commit a11a842

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

clang/lib/Headers/immintrin.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,25 +306,25 @@ _writegsbase_u64(unsigned long long __V)
306306
// REVIEW: Decide if upgrade to builtins
307307
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
308308
__writegsbyte(unsigned long __offset,unsigned char __data) {
309-
__asm__ volatile ("movb %0,%%gs:%c1"
309+
__asm__ __volatile__ ("movb %0,%%gs:%c1"
310310
: : "ir"(__data), "ir"(__offset) : "memory");
311311
}
312312

313313
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
314314
__writegsword(unsigned long __offset,unsigned short __data) {
315-
__asm__ volatile ("movw %0,%%gs:%c1"
315+
__asm__ __volatile__ ("movw %0,%%gs:%c1"
316316
: : "ir"(__data), "ir"(__offset) : "memory");
317317
}
318318

319319
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
320320
__writegsdword(unsigned long __offset,unsigned long __data) {
321-
__asm__ volatile ("movl %0,%%gs:%c1"
321+
__asm__ __volatile__ ("movl %0,%%gs:%c1"
322322
: : "ir"(__data), "ir"(__offset) : "memory");
323323
}
324324

325325
static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))
326326
__writegsqword(unsigned long __offset,unsigned __int64 __data) {
327-
__asm__ volatile ("movq %0,%%gs:%c1"
327+
__asm__ __volatile__ ("movq %0,%%gs:%c1"
328328
: : "ir"(__data), "ir"(__offset) : "memory");
329329
}
330330

clang/lib/Headers/intrin.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static __inline__ void __DEFAULT_FN_ATTRS __stosq(unsigned __int64 *__dst,
368368
\*----------------------------------------------------------------------------*/
369369
#if defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__))
370370
static __inline__ void __DEFAULT_FN_ATTRS __halt(void) {
371-
__asm__ volatile("hlt");
371+
__asm__ __volatile__("hlt");
372372
}
373373

374374
static __inline__ unsigned char __inbyte(unsigned short port) {
@@ -391,20 +391,20 @@ static __inline__ unsigned long __indword(unsigned short port) {
391391

392392
static inline void __inbytestring(unsigned short port, unsigned char* buffer, unsigned long count)
393393
{
394-
asm volatile("rep insb" : "+D"(buffer), "+c"(count) : "d"(port) : "memory");
394+
__asm__ __volatile__("rep insb" : "+D"(buffer), "+c"(count) : "d"(port) : "memory");
395395
}
396396

397397
static inline void __inwordstring(unsigned short port, unsigned short* buffer, unsigned long count)
398398
{
399-
asm volatile("rep insw" : "+D"(buffer), "+c"(count) : "d"(port) : "memory");
399+
__asm__ __volatile__("rep insw" : "+D"(buffer), "+c"(count) : "d"(port) : "memory");
400400
}
401401

402402
static inline void __indwordstring(unsigned short port, unsigned long* buffer, unsigned long count)
403403
{
404404
unsigned long* word_buffer = (unsigned long*)buffer;
405405
unsigned long word_count = count * 2; // Each double word is 2 words
406406

407-
asm volatile("rep insw" : "+D"(word_buffer), "+c"(word_count) : "d"(port) : "memory");
407+
__asm__ __volatile__("rep insw" : "+D"(word_buffer), "+c"(word_count) : "d"(port) : "memory");
408408
}
409409

410410
static __inline__ void __outbyte(unsigned short port, unsigned char data) {
@@ -421,20 +421,20 @@ static __inline__ void __outdword(unsigned short port, unsigned long data) {
421421

422422
static inline void __outbytestring(unsigned short port, unsigned char* buffer, unsigned long count)
423423
{
424-
asm volatile("rep outsb" : "+S"(buffer), "+c"(count) : "d"(port) : "memory");
424+
__asm__ __volatile__("rep outsb" : "+S"(buffer), "+c"(count) : "d"(port) : "memory");
425425
}
426426

427427
static inline void __outwordstring(unsigned short port, unsigned short* buffer, unsigned long count)
428428
{
429-
asm volatile("rep outsw" : "+S"(buffer), "+c"(count) : "d"(port) : "memory");
429+
__asm__ __volatile__("rep outsw" : "+S"(buffer), "+c"(count) : "d"(port) : "memory");
430430
}
431431

432432
static inline void __outdwordstring(unsigned short port, unsigned long* buffer, unsigned long count)
433433
{
434434
unsigned long* word_buffer = (unsigned long*)buffer;
435435
unsigned long word_count = count * 2; // Each double word is 2 words
436436

437-
asm volatile("rep outsw" : "+S"(word_buffer), "+c"(word_count) : "d"(port) : "memory");
437+
__asm__ __volatile__ ("rep outsw" : "+S"(word_buffer), "+c"(word_count) : "d"(port) : "memory");
438438
}
439439

440440
static __inline__ unsigned __int64 __readpmc(unsigned long __A) {
@@ -445,7 +445,7 @@ static __inline__ unsigned __int64 __readpmc(unsigned long __A) {
445445

446446
#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
447447
static __inline__ void __DEFAULT_FN_ATTRS __nop(void) {
448-
__asm__ volatile("nop");
448+
__asm__ __volatile__("nop");
449449
}
450450
#endif
451451

@@ -627,13 +627,13 @@ void __cdecl __prefetch(const void *);
627627
static __inline__ void __DEFAULT_FN_ATTRS
628628
_disable(void)
629629
{
630-
asm volatile ("msr DAIFSet, #2");
630+
__asm__ __volatile__ ("msr DAIFSet, #2");
631631
}
632632

633633
static __inline__ void __DEFAULT_FN_ATTRS
634634
_enable(void)
635635
{
636-
asm volatile ("msr DAIFClr, #2");
636+
__asm__ __volatile__ ("msr DAIFClr, #2");
637637
}
638638

639639
static __inline__ unsigned __int32 __DEFAULT_FN_ATTRS
@@ -655,9 +655,9 @@ __stlr64(unsigned __int64 volatile * _Target, unsigned __int64 _Value)
655655
static __inline__ void * __DEFAULT_FN_ATTRS
656656
__xpaci (void *_Pointer)
657657
{
658-
register void *__lr asm ("lr") = _Pointer;
658+
register void *__lr __asm__ ("lr") = _Pointer;
659659

660-
asm volatile ("xpaclri" : "+r"(__lr));
660+
__asm__ __volatile__ ("xpaclri" : "+r"(__lr));
661661
return __lr;
662662
}
663663

@@ -683,7 +683,7 @@ __readmsr(unsigned long __register) {
683683

684684
static __inline__ void __DEFAULT_FN_ATTRS
685685
__writemsr(unsigned long __register, unsigned __int64 __value) {
686-
asm volatile("wrmsr" : : "d"((unsigned long)(__value >> 32)), "a"((unsigned long)__value), "c"(__register));
686+
__asm__ __volatile__("wrmsr" : : "d"((unsigned long)(__value >> 32)), "a"((unsigned long)__value), "c"(__register));
687687
}
688688

689689
static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS __readcr0(void) {
@@ -738,27 +738,27 @@ static __inline__ unsigned __LPTRINT_TYPE__ __DEFAULT_FN_ATTRS __readcr8(void) {
738738

739739
static __inline__ void __DEFAULT_FN_ATTRS
740740
__writecr0(unsigned __INTPTR_TYPE__ __cr0_val) {
741-
__asm__ ("mov {%0, %%cr0|cr0, %0}" : : "r"(__cr0_val) : "memory");
741+
__asm__ __volatile__("mov {%0, %%cr0|cr0, %0}" : : "r"(__cr0_val) : "memory");
742742
}
743743

744744
static __inline__ void __DEFAULT_FN_ATTRS
745745
__writecr2(unsigned __INTPTR_TYPE__ __cr2_val) {
746-
__asm__ ("mov {%0, %%cr2|cr2, %0}" : : "r"(__cr2_val) : "memory");
746+
__asm__ __volatile__("mov {%0, %%cr2|cr2, %0}" : : "r"(__cr2_val) : "memory");
747747
}
748748

749749
static __inline__ void __DEFAULT_FN_ATTRS
750750
__writecr3(unsigned __INTPTR_TYPE__ __cr3_val) {
751-
__asm__ ("mov {%0, %%cr3|cr3, %0}" : : "r"(__cr3_val) : "memory");
751+
__asm__ __volatile__("mov {%0, %%cr3|cr3, %0}" : : "r"(__cr3_val) : "memory");
752752
}
753753

754754
static __inline__ void __DEFAULT_FN_ATTRS
755755
__writecr4(unsigned __INTPTR_TYPE__ __cr4_val) {
756-
__asm__ ("mov {%0, %%cr4|cr4, %0}" : : "r"(__cr4_val) : "memory");
756+
__asm__ __volatile__("mov {%0, %%cr4|cr4, %0}" : : "r"(__cr4_val) : "memory");
757757
}
758758

759759
static __inline__ void __DEFAULT_FN_ATTRS
760760
__writecr8(unsigned __INTPTR_TYPE__ __cr8_val) {
761-
__asm__ ("mov {%0, %%cr8|cr8, %0}" : : "r"(__cr8_val) : "memory");
761+
__asm__ __volatile__("mov {%0, %%cr8|cr8, %0}" : : "r"(__cr8_val) : "memory");
762762
}
763763

764764
static __inline__ void __lidt(void *source) {
@@ -770,11 +770,11 @@ static __inline__ void __sidt(void *source) {
770770
}
771771

772772
static __inline__ void _enable(void) {
773-
__asm__ volatile("sti");
773+
__asm__ __volatile__("sti");
774774
}
775775

776776
static __inline__ void _disable(void) {
777-
__asm__ volatile("cli");
777+
__asm__ __volatile__("cli");
778778
}
779779

780780
static __inline__ void _clac(void) {
@@ -786,7 +786,7 @@ static __inline__ void _stac(void) {
786786
}
787787

788788
static __inline__ void __invlpg(void *va) {
789-
asm volatile("invlpg (%0)" : : "r"(va) : "memory");
789+
__asm__ __volatile__("invlpg (%0)" : : "r"(va) : "memory");
790790
}
791791

792792
#endif

0 commit comments

Comments
 (0)