From 1c6d2ff03d16acf87c96d019153dcd10c779a5f6 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Mon, 27 Aug 2012 00:44:42 +0000 Subject: Some ISO C fixes This patch just fixes a limited number of bits not conforming to c99 by using - __asm__ instead of just asm - {0} instead of {} for struct initialization - h_addr_list[0] instead of h_addr to access the host address in struct hostent - #include where needed (for ffs and strcasecmp) Based on a previous patch by Carl-Daniel. Corresponding to flashrom svn r1585. Signed-off-by: Carl-Daniel Hailfinger Signed-off-by: Stefan Tauner Acked-by: Carl-Daniel Hailfinger --- hwaccess.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'hwaccess.h') diff --git a/hwaccess.h b/hwaccess.h index 12496bb..dc52118 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -174,7 +174,6 @@ cpu_to_be(64) /* for iopl and outb under Solaris */ #if defined (__sun) && (defined(__i386) || defined(__amd64)) -#include #include #include #include @@ -263,37 +262,37 @@ cpu_to_be(64) static inline void outb(uint8_t value, uint16_t port) { - asm volatile ("outb %b0,%w1": :"a" (value), "Nd" (port)); + __asm__ volatile ("outb %b0,%w1": :"a" (value), "Nd" (port)); } static inline uint8_t inb(uint16_t port) { uint8_t value; - asm volatile ("inb %w1,%0":"=a" (value):"Nd" (port)); + __asm__ volatile ("inb %w1,%0":"=a" (value):"Nd" (port)); return value; } static inline void outw(uint16_t value, uint16_t port) { - asm volatile ("outw %w0,%w1": :"a" (value), "Nd" (port)); + __asm__ volatile ("outw %w0,%w1": :"a" (value), "Nd" (port)); } static inline uint16_t inw(uint16_t port) { uint16_t value; - asm volatile ("inw %w1,%0":"=a" (value):"Nd" (port)); + __asm__ volatile ("inw %w1,%0":"=a" (value):"Nd" (port)); return value; } static inline void outl(uint32_t value, uint16_t port) { - asm volatile ("outl %0,%w1": :"a" (value), "Nd" (port)); + __asm__ volatile ("outl %0,%w1": :"a" (value), "Nd" (port)); } static inline uint32_t inl(uint16_t port) { uint32_t value; - asm volatile ("inl %1,%0":"=a" (value):"Nd" (port)); + __asm__ volatile ("inl %1,%0":"=a" (value):"Nd" (port)); return value; } #endif -- cgit v1.1