summaryrefslogtreecommitdiffstats
path: root/hwaccess.h
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-27 00:44:42 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-08-27 00:44:42 +0000
commit166ff2936c347e4f7a2bc8d2ef29116989889f55 (patch)
treeb211be01cc5f25fa78321dd434e42aafa9ea3f0e /hwaccess.h
parent5b3251235df6ffdb8d057519be8a2afc77ccdce7 (diff)
downloadflashrom-166ff2936c347e4f7a2bc8d2ef29116989889f55.zip
flashrom-166ff2936c347e4f7a2bc8d2ef29116989889f55.tar.gz
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 <strings.h> 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 <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'hwaccess.h')
-rw-r--r--hwaccess.h13
1 files changed, 6 insertions, 7 deletions
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 <strings.h>
#include <sys/sysi86.h>
#include <sys/psw.h>
#include <asm/sunddi.h>
@@ -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
OpenPOWER on IntegriCloud