]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
asm: Replace "__asm__ __volatile__" with "asm volatile"
authorJesús Diéguez Fernández <jesusdf@gmail.com>
Fri, 8 Mar 2019 00:26:36 +0000 (01:26 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 12 Mar 2019 19:04:07 +0000 (20:04 +0100)
In order to maintain the coding style consistency, it was requested to
replace the methods that use "__asm__ __volatile__" with "asm volatile".

Signed-off-by: Jesús Diéguez Fernández <jesusdf@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/efiemu/runtime/efiemu.c
grub-core/lib/i386/halt.c
include/grub/arm/time.h
include/grub/arm64/time.h
include/grub/i386/io.h
include/grub/i386/time.h
include/grub/i386/tsc.h
include/grub/x86_64/time.h

index d923e409f921384dfe29a9b241bb2feb7a0b0e38..5db1f347b5db54cc7ffc139e69f336f2cdf01dd6 100644 (file)
@@ -174,17 +174,17 @@ efiemu_memset (grub_uint8_t *a, grub_uint8_t b, grub_size_t n)
 static inline void
 write_cmos (grub_uint8_t addr, grub_uint8_t val)
 {
-  __asm__ __volatile__ ("outb %%al,$0x70\n"
-                       "mov %%cl, %%al\n"
-                       "outb %%al,$0x71": :"a" (addr), "c" (val));
+  asm volatile ("outb %%al,$0x70\n"
+               "mov %%cl, %%al\n"
+               "outb %%al,$0x71": :"a" (addr), "c" (val));
 }
 
 static inline grub_uint8_t
 read_cmos (grub_uint8_t addr)
 {
   grub_uint8_t ret;
-  __asm__ __volatile__ ("outb %%al, $0x70\n"
-                       "inb $0x71, %%al": "=a"(ret) :"a" (addr));
+  asm volatile ("outb %%al, $0x70\n"
+               "inb $0x71, %%al": "=a"(ret) :"a" (addr));
   return ret;
 }
 
index 9f840549407bcbd7cef6082b3f444d88d8fee58c..2364fe4d749913e61603baa0b1882d739dad8132 100644 (file)
@@ -66,7 +66,7 @@ grub_halt (void)
 #endif
 
   /* Disable interrupts.  */
-  __asm__ __volatile__ ("cli");
+  asm volatile ("cli");
 
   /* Bochs, QEMU, etc. Removed in newer QEMU releases.  */
   for (i = 0; i < sizeof (bochs_shutdown) - 1; i++)
index 4128506cb702d9ef4fe72107f774b4eb2d484a48..c5a6852253389134d3ad01eceb4768a710fa3af1 100644 (file)
@@ -23,7 +23,7 @@ static __inline void
 grub_cpu_idle (void)
 {
   /* FIXME: this can't work until we handle interrupts.  */
-/*  __asm__ __volatile__ ("wfi"); */
+/*  asm volatile ("wfi"); */
 }
 
 #endif /* ! KERNEL_CPU_TIME_HEADER */
index 4128506cb702d9ef4fe72107f774b4eb2d484a48..c5a6852253389134d3ad01eceb4768a710fa3af1 100644 (file)
@@ -23,7 +23,7 @@ static __inline void
 grub_cpu_idle (void)
 {
   /* FIXME: this can't work until we handle interrupts.  */
-/*  __asm__ __volatile__ ("wfi"); */
+/*  asm volatile ("wfi"); */
 }
 
 #endif /* ! KERNEL_CPU_TIME_HEADER */
index ae12a3e3dc12976f351069858f9f27f56d19df3d..e9cd8095751a4b449c1ffbafb4a44dcb87897a43 100644 (file)
@@ -28,7 +28,7 @@ grub_inb (unsigned short int port)
 {
   unsigned char _v;
 
-  __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
+  asm volatile ("inb %w1,%0":"=a" (_v):"Nd" (port));
   return _v;
 }
 
@@ -37,7 +37,7 @@ grub_inw (unsigned short int port)
 {
   unsigned short _v;
 
-  __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
+  asm volatile ("inw %w1,%0":"=a" (_v):"Nd" (port));
   return _v;
 }
 
@@ -46,27 +46,27 @@ grub_inl (unsigned short int port)
 {
   unsigned int _v;
 
-  __asm__ __volatile__ ("inl %w1,%0":"=a" (_v):"Nd" (port));
+  asm volatile ("inl %w1,%0":"=a" (_v):"Nd" (port));
   return _v;
 }
 
 static __inline void
 grub_outb (unsigned char value, unsigned short int port)
 {
-  __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
+  asm volatile ("outb %b0,%w1": :"a" (value), "Nd" (port));
 }
 
 static __inline void
 grub_outw (unsigned short int value, unsigned short int port)
 {
-  __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
+  asm volatile ("outw %w0,%w1": :"a" (value), "Nd" (port));
 
 }
 
 static __inline void
 grub_outl (unsigned int value, unsigned short int port)
 {
-  __asm__ __volatile__ ("outl %0,%w1": :"a" (value), "Nd" (port));
+  asm volatile ("outl %0,%w1": :"a" (value), "Nd" (port));
 }
 
 #endif /* _SYS_IO_H */
index 842882cf24914acf9c614c77c74712a4e4d0af16..4da5ae93cdb6f52fc1497cb91f9889dc787d04a0 100644 (file)
@@ -23,7 +23,7 @@ static __inline void
 grub_cpu_idle (void)
 {
   /* FIXME: this can't work until we handle interrupts.  */
-/*  __asm__ __volatile__ ("hlt"); */
+/*  asm volatile ("hlt"); */
 }
 
 #endif /* ! KERNEL_CPU_TIME_HEADER */
index 324174deddb3236a0c7f6390d081392f12287e90..947e62fa1a13b719578e1954cca1f89e180c2b2b 100644 (file)
@@ -46,7 +46,7 @@ grub_get_tsc (void)
   grub_cpuid (0,a,b,c,d);
   /* Read TSC value.  We cannot use "=A", since this would use
      %rax on x86_64. */
-  __asm__ __volatile__ ("rdtsc":"=a" (lo), "=d" (hi));
+  asm volatile ("rdtsc":"=a" (lo), "=d" (hi));
 
   return (((grub_uint64_t) hi) << 32) | lo;
 }
index 842882cf24914acf9c614c77c74712a4e4d0af16..4da5ae93cdb6f52fc1497cb91f9889dc787d04a0 100644 (file)
@@ -23,7 +23,7 @@ static __inline void
 grub_cpu_idle (void)
 {
   /* FIXME: this can't work until we handle interrupts.  */
-/*  __asm__ __volatile__ ("hlt"); */
+/*  asm volatile ("hlt"); */
 }
 
 #endif /* ! KERNEL_CPU_TIME_HEADER */