فهرست منبع

fixes from psm: use __asm__/__volatile__

Mike Frysinger 18 سال پیش
والد
کامیت
eec3830469
2فایلهای تغییر یافته به همراه22 افزوده شده و 22 حذف شده
  1. 6 6
      libc/sysdeps/linux/arm/ioperm.c
  2. 16 16
      libc/sysdeps/linux/arm/syscall.c

+ 6 - 6
libc/sysdeps/linux/arm/ioperm.c

@@ -222,40 +222,40 @@ libc_hidden_def(ioperm)
 void
 outb(unsigned char b, unsigned long int port)
 {
-    *((volatile unsigned char *)(IO_ADDR (port))) = b;
+    *((__volatile__ unsigned char *)(IO_ADDR (port))) = b;
 }
 
 
 void
 outw(unsigned short b, unsigned long int port)
 {
-    *((volatile unsigned short *)(IO_ADDR (port))) = b;
+    *((__volatile__ unsigned short *)(IO_ADDR (port))) = b;
 }
 
 
 void
 outl(unsigned long b, unsigned long int port)
 {
-    *((volatile unsigned long *)(IO_ADDR (port))) = b;
+    *((__volatile__ unsigned long *)(IO_ADDR (port))) = b;
 }
 
 
 unsigned char
 inb (unsigned long int port)
 {
-    return *((volatile unsigned char *)(IO_ADDR (port)));
+    return *((__volatile__ unsigned char *)(IO_ADDR (port)));
 }
 
 
 unsigned short int
 inw(unsigned long int port)
 {
-    return *((volatile unsigned short *)(IO_ADDR (port)));
+    return *((__volatile__ unsigned short *)(IO_ADDR (port)));
 }
 
 
 unsigned long int
 inl(unsigned long int port)
 {
-    return *((volatile unsigned long *)(IO_ADDR (port)));
+    return *((__volatile__ unsigned long *)(IO_ADDR (port)));
 }

+ 16 - 16
libc/sysdeps/linux/arm/syscall.c

@@ -15,14 +15,14 @@
 long syscall(long sysnum, long a, long b, long c, long d, long e, long f)
 {
 #if !defined(__thumb__)
-	register long _r0 asm("r0")=(long)(sysnum);
-	register long _r6 asm("r6")=(long)(f);
-	register long _r5 asm("r5")=(long)(e);
-	register long _r4 asm("r4")=(long)(d);
-	register long _r3 asm("r3")=(long)(c);
-	register long _r2 asm("r2")=(long)(b);
-	register long _r1 asm("r1")=(long)(a);
-	asm volatile(
+	register long _r0 __asm__("r0")=(long)(sysnum);
+	register long _r6 __asm__("r6")=(long)(f);
+	register long _r5 __asm__("r5")=(long)(e);
+	register long _r4 __asm__("r4")=(long)(d);
+	register long _r3 __asm__("r3")=(long)(c);
+	register long _r2 __asm__("r2")=(long)(b);
+	register long _r1 __asm__("r1")=(long)(a);
+	__asm__ __volatile__(
 			"swi %1"
 			: "=r"(_r0)
 			: "i"(__NR_syscall), "r"(_r0), "r"(_r1),
@@ -30,14 +30,14 @@ long syscall(long sysnum, long a, long b, long c, long d, long e, long f)
 			"r"(_r6)
 			: "memory");
 #else
-	register long _r7 asm("r7")=(long)(sysnum);
-	register long _r5 asm("r5")=(long)(f);
-	register long _r4 asm("r4")=(long)(e);
-	register long _r3 asm("r3")=(long)(d);
-	register long _r2 asm("r2")=(long)(c);
-	register long _r1 asm("r1")=(long)(b);
-	register long _r0 asm("r0")=(long)(a);
-	asm volatile(
+	register long _r7 __asm__("r7")=(long)(sysnum);
+	register long _r5 __asm__("r5")=(long)(f);
+	register long _r4 __asm__("r4")=(long)(e);
+	register long _r3 __asm__("r3")=(long)(d);
+	register long _r2 __asm__("r2")=(long)(c);
+	register long _r1 __asm__("r1")=(long)(b);
+	register long _r0 __asm__("r0")=(long)(a);
+	__asm__ __volatile__(
 			"swi 0"
 			: "=r"(_r0)
 			: "r"(_r0), "r"(_r1), "r"(_r2), "r"(_r3),